Ver Fonte

Fix the installer copy command (#1432)

Abouzar Parvan há 3 anos atrás
pai
commit
67a0ee6fdd
1 ficheiros alterados com 13 adições e 1 exclusões
  1. 13 1
      utils/installer/install.sh

+ 13 - 1
utils/installer/install.sh

@@ -210,11 +210,23 @@ function backup_old_config() {
     # we create an empty folder for subsequent commands \
     # that require an existing directory
     mkdir -p "$dir" "$dir.bak"
+    touch "$dir/ignore"
     if command -v rsync &>/dev/null; then
       rsync --archive -hh --partial --progress --cvs-exclude \
         --modify-window=1 "$dir"/ "$dir.bak"
     else
-      cp -R "$dir/"* "$dir.bak/."
+      OS="$(uname -s)"
+      case "$OS" in
+        Linux)
+          cp -r "$dir/"* "$dir.bak/."
+          ;;
+        Darwin)
+          cp -R "$dir/"* "$dir.bak/."
+          ;;
+        *)
+          echo "OS $OS is not currently supported."
+          ;;
+      esac
     fi
   done
   echo "Backup operation complete"