Parcourir la source

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

Nicolas Meienberger il y a 2 ans
Parent
commit
3da4c353cd
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  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"