From d4b267118c233aecb78eb9a04ca0400326f99910 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 16 Aug 2013 21:25:01 +0100 Subject: [PATCH] First run the function, then return the exit code. Fixes #206. --- bootstrap-salt.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 48e8cbf..72dc0eb 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -986,7 +986,7 @@ copyfile() { elif [ -f "$dfile" ] && [ $overwrite -eq $BS_TRUE ]; then # The destination exist and we're overwriting echodebug "Overriding $dfile with $sfile" - cp -f "$sfile" "$dfile" || return 2 + cp -f "$sfile" "$dfile" || return 1 elif [ -f "$dfile" ] && [ $overwrite -ne $BS_TRUE ]; then echodebug "Not overriding $dfile with $sfile" fi @@ -1017,7 +1017,8 @@ movefile() { # We're being told not to move files, instead copy them so we can keep # them around echodebug "Since BS_KEEP_TEMP_FILES=1 we're copying files instead of moving them" - return copyfile "$sfile" "$dfile" $overwrite + copyfile "$sfile" "$dfile" $overwrite + return $? fi # Does the source file exist?