Add a validation in linkFile
This commit is contained in:
parent
02644a2422
commit
33a4fd4203
|
@ -10,6 +10,8 @@ linkFile() {
|
||||||
mv "$2" "${2}.backup"
|
mv "$2" "${2}.backup"
|
||||||
ln -s "$1" "$2"
|
ln -s "$1" "$2"
|
||||||
else
|
else
|
||||||
|
[ -h "$2" ] && [ "$1" = $(realpath "$2") ] && continue
|
||||||
|
|
||||||
msg="\nFile already exists: '${2//$HOME\//}', what would you like to do?"
|
msg="\nFile already exists: '${2//$HOME\//}', what would you like to do?"
|
||||||
options=(1 "Skip" 2 "Skip all" 3 "Overwrite" 4 "Overwrite all" 5 "Backup" 6 "Backup all")
|
options=(1 "Skip" 2 "Skip all" 3 "Overwrite" 4 "Overwrite all" 5 "Backup" 6 "Backup all")
|
||||||
selectedOption=$(displayDialogBox --menu "$msg" VALUES 0 "${options[@]}" 3>&1 1>&2 2>&3)
|
selectedOption=$(displayDialogBox --menu "$msg" VALUES 0 "${options[@]}" 3>&1 1>&2 2>&3)
|
||||||
|
|
Loading…
Reference in New Issue