build.sh: bail if run in the wrong directory.
authorAugie Fackler <durin42@gmail.com>
Thu, 12 Mar 2009 14:16:55 +0000
changeset 1808 f6ec0f486247
parent 1807 1f8cde169f32
child 1809 66aec0241d61
build.sh: bail if run in the wrong directory. Patch by: Augie Fackler
scripts/build.sh
--- a/scripts/build.sh	Thu Mar 12 13:39:57 2009 +0000
+++ b/scripts/build.sh	Thu Mar 12 14:16:55 2009 +0000
@@ -20,7 +20,12 @@
 APP_DIRS=${APP_DIRS:-"${DEFAULT_APP_DIRS}"}
 ZIP_FILES=${ZIP_FILES:-"${DEFAULT_ZIP_FILES}"}
 
-cd $APP_FOLDER
+if [ -e $APP_FOLDER ] ; then
+    cd $APP_FOLDER
+else
+    echo 'This script must be run from within the scripts directory!'
+    exit 1
+fi
 
 # Remove old zip files (and django.zip in its old location)
 rm -rf $ZIP_FILES django.zip
@@ -75,4 +80,3 @@
 done
 
 echo "Build results in $APP_BUILD."
-