fix: ensure that diffing is done in the right direction
This commit is contained in:
parent
bc0f75e65c
commit
7a71ab38f4
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ copy_file() {
|
|||
return 0
|
||||
fi
|
||||
|
||||
difference=$(diff "$source_path" "$dest_path")
|
||||
difference=$(diff "$dest_path" "$source_path")
|
||||
|
||||
if [ -z "$difference" ]; then
|
||||
echo "$dest_path already exists, but is the same as $source_path - skipping."
|
||||
|
@ -67,7 +67,7 @@ copy_file() {
|
|||
fi
|
||||
|
||||
echo "Differences detected between $source_path and $dest_path:"
|
||||
diff --color "$source_path" "$dest_path"
|
||||
diff --color "$dest_path" "$source_path"
|
||||
read -p "$dest_path already exists. What should be done? [O:overwrite,S:skip,B:save backup and copy] " -r action
|
||||
|
||||
if [[ $action == "O" ]]; then
|
||||
|
|
Loading…
Reference in a new issue