Rerun bootstrap if .setup.sh is empty
Bug: 59
Change-Id: I5db04bc830286109fd9ed051afdfb578d7234775
diff --git a/env_setup/env_setup.sh b/env_setup/env_setup.sh
index 5e53823..97e5519 100644
--- a/env_setup/env_setup.sh
+++ b/env_setup/env_setup.sh
@@ -45,12 +45,11 @@
PYTHON=python
fi
-# Expanded logic here to make this both easy to read and not bash-specific.
-# If user sourced 'bootstrap.sh' or if there is no '.setup.sh' then run
-# env_setup.py.
-if [ $(basename $PW_SETUP_SCRIPT_PATH) = "bootstrap.sh" ]; then
- $PYTHON $PW_ROOT/env_setup/env_setup.py --shell-file $SETUP_SH
-elif [ ! -f $SETUP_SH ]; then
+# Run full bootstrap when invoked as bootstrap, or env file is missing/empty.
+if \
+ [ $(basename $PW_SETUP_SCRIPT_PATH) = "bootstrap.sh" ] || \
+ [ ! -f $SETUP_SH ] || \
+ [ ! -s $SETUP_SH ]; then
$PYTHON $PW_ROOT/env_setup/env_setup.py --shell-file $SETUP_SH
fi