-
Notifications
You must be signed in to change notification settings - Fork 710
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
activated_path_skip
on repeated running of emsdk_env.sh
The first time around `node` was being correctly added to the PATH, but the second time around this code was observing the emsdk copy of node in the PATH and assuming it could be skipped. Fixes: #1240
- Loading branch information
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Test that node is added to that PATH if, and only if, it is not one already present". | ||
|
||
if [ -n "$EMSDK" ]; then | ||
echo "EMSDK is already defined in this shell. Run tests in a shell without sourcing emsdk_env.sh first" | ||
exit 1 | ||
fi | ||
|
||
DIR=$(dirname "$BASH_SOURCE") | ||
cd $DIR/.. | ||
|
||
./emsdk install latest | ||
./emsdk activate latest | ||
|
||
if which node; then | ||
echo "Test should be run without node in the path" | ||
exit 1 | ||
fi | ||
|
||
# Run emsdk_env.sh and confirm that node was added to the PATH | ||
. emsdk_env.sh | ||
|
||
if ! which node; then | ||
echo "node not found in path after emsdk_env.sh" | ||
exit 1 | ||
fi | ||
|
||
# Run emsdk_env.sh again and confirm that node is still in the PATH | ||
. emsdk_env.sh | ||
|
||
if ! which node; then | ||
echo "node not found in path after emsdk_env.sh" | ||
exit 1 | ||
fi |