Don't remove existing stuff in /tmp
authorCameron Ball <cameron@cameron1729.xyz>
Mon, 8 Apr 2019 16:45:53 +0000 (00:45 +0800)
committerCameron Ball <cameron@cameron1729.xyz>
Mon, 8 Apr 2019 16:45:53 +0000 (00:45 +0800)
SongSync.sh

index afe993b..e0eafd3 100755 (executable)
@@ -85,8 +85,8 @@ if [ "$1" = "apply" ]; then
 
     for removal_path in "${!removes[@]}"; do
         if [ -d "/tmp/${removes[$removal_path]}" ]; then
-            echo "need to rm /tmp/${removes[$removal_path]}"
-            rm -rf "/tmp/${removes[$removal_path]}"
+            echo "/tmp/${removes[$removal_path]} already exists, skipping"
+            continue
         fi
 
         echo "Moving ${removal_path} to /tmp/${removes[$removal_path]}"