Skip to content

Commit

Permalink
Fix activate.sh to find CHIP_ROOT (project-chip#1585)
Browse files Browse the repository at this point in the history
* fix activate.sh

* fix bootstrap.sh, too
  • Loading branch information
Rob Walker authored and kedars committed Jul 21, 2020
1 parent 7cf0d80 commit 741db9d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 6 additions & 3 deletions scripts/activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 7 additions & 1 deletion scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 741db9d

Please sign in to comment.