From 4fa1ca33fcdecc22bcfb00fb5d138342a5092780 Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Mon, 13 Jul 2020 16:13:21 -0700 Subject: [PATCH 1/2] fix activate.sh --- scripts/activate.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/activate.sh b/scripts/activate.sh index 811f98351762f4..4c82647ca87d0a 100644 --- a/scripts/activate.sh +++ b/scripts/activate.sh @@ -13,9 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -if [[ ! -d "${CHIP_ROOT}" ]]; then - CHIP_ROOT=$(cd "$(dirname "$0")/.." && pwd) +if [[ ! -d ${CHIP_ROOT} ]]; then + if [[ -n ${BASH_SOURCE[0]} ]]; then + CHIP_ROOT=$(cd "${BASH_SOURCE[0]%/*}/.." && pwd) + else + CHIP_ROOT=$(cd "${0%/*}/.." && pwd) + fi fi export PW_BRANDING_BANNER="$CHIP_ROOT/.chip-banner.txt" From c66090ae051d31c463e52c13c946ff2f6299fc47 Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Mon, 13 Jul 2020 23:11:13 -0700 Subject: [PATCH 2/2] fix bootstrap.sh, too --- scripts/bootstrap.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index c26a06d5f303df..6fa79dde5b8d07 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -14,7 +14,13 @@ # limitations under the License. # -CHIP_ROOT=$(cd "$(dirname "$0")/.." && pwd) +if [[ ! -d ${CHIP_ROOT} ]]; then + if [[ -n ${BASH_SOURCE[0]} ]]; then + CHIP_ROOT=$(cd "${BASH_SOURCE[0]%/*}/.." && pwd) + else + CHIP_ROOT=$(cd "${0%/*}/.." && pwd) + fi +fi export PW_BRANDING_BANNER="$CHIP_ROOT/.chip-banner.txt" export PW_BRANDING_BANNER_COLOR="bold_white"