diff options
author | WorMzy Tykashi | 2016-11-24 23:46:59 +0000 |
---|---|---|
committer | WorMzy Tykashi | 2016-11-24 23:46:59 +0000 |
commit | bff02878b7dbbec74cc68948f43a5c67337f44ea (patch) | |
tree | 7dd15ad246c177de47a38625f3d0afa16816c833 | |
parent | 5eff6784ce54f13c18d9f41199592cc99b04d2b1 (diff) | |
download | aur-bff02878b7dbbec74cc68948f43a5c67337f44ea.tar.gz |
Made script handle spaces in directory names
-rwxr-xr-x | copier.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/copier.sh b/copier.sh index 8a9315714fdb..247a8ef6255d 100755 --- a/copier.sh +++ b/copier.sh @@ -11,7 +11,7 @@ if [ ! -r filelist ]; then fi read -p "Enter the path to the X-COM data files: " _xcompath -if [ ! -d $_xcompath ]; then +if [ ! -d "$_xcompath" ]; then echo "ERROR: No such directory" exit 1 fi @@ -22,31 +22,31 @@ for file in $(cat filelist); do # Handle files with identical names but different content case "$file" in DP_PREFS|INTICON.PCK|INTICON.TAB) - if ! find $_xcompath -path "*UFOGRAPH/$file" -exec cp "{}" ./"ufo-$file" \; &>/dev/null; then + if ! find "$_xcompath" -path "*UFOGRAPH/$file" -exec cp "{}" ./"ufo-$file" \; &>/dev/null; then _fail $file fi - if ! find $_xcompath -path "*GEOGRAPH/$file" -exec cp "{}" ./"geo-$file" \; &>/dev/null; then + if ! find "$_xcompath" -path "*GEOGRAPH/$file" -exec cp "{}" ./"geo-$file" \; &>/dev/null; then _fail $file fi ;; GEODATA.DAT) - if ! find $_xcompath -path "*MISSDAT/$file" -exec cp "{}" ./"missdat-$file" \; &>/dev/null; then + if ! find "$_xcompath" -path "*MISSDAT/$file" -exec cp "{}" ./"missdat-$file" \; &>/dev/null; then _fail $file fi - if ! find $_xcompath -path "*MAPS/$file" -exec cp "{}" ./"maps-$file" \; &>/dev/null; then + if ! find "$_xcompath" -path "*MAPS/$file" -exec cp "{}" ./"maps-$file" \; &>/dev/null; then _fail $file fi ;; SOUND.CFG) - if ! find $_xcompath -path "*XCOM/$file" -exec cp "{}" ./"xcom-$file" \; &>/dev/null; then + if ! find "$_xcompath" -path "*XCOM/$file" -exec cp "{}" ./"xcom-$file" \; &>/dev/null; then _fail $file fi - if ! find $_xcompath -path "*SOUND/$file" -exec cp "{}" ./"sound-$file" \; &>/dev/null; then + if ! find "$_xcompath" -path "*SOUND/$file" -exec cp "{}" ./"sound-$file" \; &>/dev/null; then _fail $file fi ;; *) - if ! find $_xcompath -name "$file" -exec cp "{}" . \; &>/dev/null; then + if ! find "$_xcompath" -name "$file" -exec cp "{}" . \; &>/dev/null; then _fail $file fi ;; |