From 51b98f009118991bc9cbc0cc95f8b7ce5ab4c306 Mon Sep 17 00:00:00 2001 From: schneems Date: Thu, 21 Jul 2022 14:49:40 -0500 Subject: [PATCH] Differentiate error conditions When you commit to git with only one directory and nothing else in root, it will push the contents of just that directory. I.e. an app with this structure fails to deploy: ``` mkdir -p app touch app/Gemfile touch app/Gemfile.lock git init .; git add . ; git commit -m "first" ``` The error message is `PROJECT_PATH is undefined` which is incorrect. I added another error message that would properly identify the failure mode and give you more debugging information. --- bin/compile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/bin/compile b/bin/compile index 086157a..b3047fd 100755 --- a/bin/compile +++ b/bin/compile @@ -25,10 +25,17 @@ if [ -f $ENV_DIR/PROJECT_PATH ]; then echo " cleaning tmp dir $TMP_DIR" rm -rf $TMP_DIR exit 0 + else + echo " PROJECT_PATH is defined but does not exist" + echo " expected $BUILD_DIR to contain $PROJECT_PATH" + echo " but it does not." + echo "" + echo "Contents of $BUILD_DIR:" + echo "" + ls -la $BUILD_DIR + exit 1 fi +else + echo " PROJECT_PATH is undefined" + exit 1 fi - -echo "PROJECT_PATH is undefined" -exit 1 - -