Fix activate.sh with set -e
Currently activate.sh terminates the shell if sources under set -e. Fix
it by using a conditional for the bootstrapping test.
Bug: 260
Change-Id: Ifa2350ed84d3257555252574cd6239cb927c738b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17780
Commit-Queue: Rob Mohr <mohrr@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
diff --git a/bootstrap.sh b/bootstrap.sh
index 11e44e1..fc9dfde 100644
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -185,10 +185,13 @@
fi
# Run full bootstrap when invoked as bootstrap, or env file is missing/empty.
-[ "$(basename "$PW_SETUP_SCRIPT_PATH")" = "bootstrap.sh" ] || \
+if [ "$(basename "$PW_SETUP_SCRIPT_PATH")" = "bootstrap.sh" ] || \
[ ! -f "$SETUP_SH" ] || \
- [ ! -s "$SETUP_SH" ]
-_PW_IS_BOOTSTRAP="$?"
+ [ ! -s "$SETUP_SH" ]; then
+ _PW_IS_BOOTSTRAP=0
+else
+ _PW_IS_BOOTSTRAP=1
+fi
if [ "$_PW_IS_BOOTSTRAP" -eq 0 ]; then
_PW_NAME="bootstrap"