Kaynağa Gözat

Allow webui.sh to be runnable from directories containing a .git file

Speculative Moonstone 1 yıl önce
ebeveyn
işleme
ba2a737cce
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 3 3
      webui.sh

+ 3 - 3
webui.sh

@@ -113,13 +113,13 @@ then
     exit 1
     exit 1
 fi
 fi
 
 
-if [[ -d .git ]]
+if [[ -d "$SCRIPT_DIR/.git" ]]
 then
 then
     printf "\n%s\n" "${delimiter}"
     printf "\n%s\n" "${delimiter}"
     printf "Repo already cloned, using it as install directory"
     printf "Repo already cloned, using it as install directory"
     printf "\n%s\n" "${delimiter}"
     printf "\n%s\n" "${delimiter}"
-    install_dir="${PWD}/../"
-    clone_dir="${PWD##*/}"
+    install_dir="${SCRIPT_DIR}/../"
+    clone_dir="${SCRIPT_DIR##*/}"
 fi
 fi
 
 
 # Check prerequisites
 # Check prerequisites