瀏覽代碼

feat(start script): ensure the user runs the command from the root folder

Nicolas Meienberger 3 年之前
父節點
當前提交
3da4c353cd
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      scripts/start.sh

+ 6 - 0
scripts/start.sh

@@ -46,6 +46,12 @@ while [ -n "$1" ]; do # while loop starts
   shift
 done
 
+# Ensure BASH_SOURCE is ./scripts/start.sh
+if [[ "${BASH_SOURCE[0]}" != "./scripts/start.sh" ]]; then
+  echo "Please make sure this script is executed from runtipi/"
+  exit 1
+fi
+
 # Check we are on linux
 if [[ "$(uname)" != "Linux" ]]; then
   echo "Tipi only works on Linux"