Skip to content

Commit

Permalink
Fix bootstrapping with relative CHIP_ROOT already set (#3291)
Browse files Browse the repository at this point in the history
.. by always setting CHIP_ROOT to the right (absolute) value.
  • Loading branch information
mspang authored and pull[bot] committed Dec 7, 2020
1 parent 2832f8e commit ac777dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
1 change: 1 addition & 0 deletions integrations/mobly/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.egg-info
11 changes: 5 additions & 6 deletions scripts/activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
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

if [[ -n ${BASH_SOURCE[0]} ]]; then
CHIP_ROOT=$(cd "${BASH_SOURCE[0]%/*}/.." && pwd)
else
CHIP_ROOT=$(cd "${0%/*}/.." && pwd)
fi

export PW_BRANDING_BANNER="$CHIP_ROOT/.chip-banner.txt"
Expand Down
10 changes: 4 additions & 6 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
# limitations under the License.
#

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
if [[ -n ${BASH_SOURCE[0]} ]]; then
CHIP_ROOT=$(cd "${BASH_SOURCE[0]%/*}/.." && pwd)
else
CHIP_ROOT=$(cd "${0%/*}/.." && pwd)
fi

export PW_BRANDING_BANNER="$CHIP_ROOT/.chip-banner.txt"
Expand Down

0 comments on commit ac777dc

Please sign in to comment.