From 71dabfde76bc9185b041911135a40a7afe6f5256 Mon Sep 17 00:00:00 2001 From: Anton Johansson Date: Wed, 5 Oct 2016 17:13:56 +0200 Subject: [PATCH 1/3] Add script for SVN repair move Progress on #4 --- README.md | 1 + svn-repair-move | 4 ++++ 2 files changed, 5 insertions(+) create mode 100755 svn-repair-move diff --git a/README.md b/README.md index 9f88b0a..fd273b1 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ sudo ln -s ~/Projects/useful-bash-scripts/mark-for-comparison /usr/local/bin/mar sudo ln -s ~/Projects/useful-bash-scripts/compare-with-marked /usr/local/bin/compare-with-marked sudo ln -s ~/Projects/useful-bash-scripts/is-marked /usr/local/bin/is-marked sudo ln -s ~/Projects/useful-bash-scripts/copy-to-dbupdate /usr/local/bin/copy-to-dbupdate +sudo ln -s ~/Projects/useful-bash-scripts/svn-repair-move /usr/local/bin/svn-repair-move ``` #### Nemo actions diff --git a/svn-repair-move b/svn-repair-move new file mode 100755 index 0000000..bde8ba1 --- /dev/null +++ b/svn-repair-move @@ -0,0 +1,4 @@ +#!/bin/bash + +mv $2 $1 +svn mv $1 $2 From 0bdb6f64b4179fe37a4d16dc5d3a635317f40783 Mon Sep 17 00:00:00 2001 From: Anton Johansson Date: Thu, 6 Oct 2016 10:31:24 +0200 Subject: [PATCH 2/3] Add error checks and minor code improvements --- svn-repair-move | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/svn-repair-move b/svn-repair-move index bde8ba1..a7d5f77 100755 --- a/svn-repair-move +++ b/svn-repair-move @@ -1,4 +1,24 @@ #!/bin/bash +# title: svn-repair-move +# description: Performs an SVN repair move +# parameter #1: source file +# parameter #2: target file -mv $2 $1 -svn mv $1 $2 +# Variables +source="$1" +target="$2" + +# Error checks +if [[ ! -f $source ]]; then + echo "Source must be a file..." + exit 1 +fi + +if [[ ! -f $target ]]; then + echo "Target must be a file..." + exit 1 +fi + +# Execution +mv $target $source +svn mv $source $target From ac1b6fefbccfff52c8b397318a6980e955d8e1d0 Mon Sep 17 00:00:00 2001 From: Anton Johansson Date: Thu, 6 Oct 2016 10:32:37 +0200 Subject: [PATCH 3/3] Remove tabs --- svn-repair-move | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/svn-repair-move b/svn-repair-move index a7d5f77..2298f9f 100755 --- a/svn-repair-move +++ b/svn-repair-move @@ -1,8 +1,8 @@ #!/bin/bash -# title: svn-repair-move -# description: Performs an SVN repair move -# parameter #1: source file -# parameter #2: target file +# title: svn-repair-move +# description: Performs an SVN repair move +# parameter #1: source file +# parameter #2: target file # Variables source="$1"