Mercurial
comparison third_party/emsdk/test/test_node_path.sh @ 179:8d17f6e6e290
[ThirdParty] Added emsdk bazel rules that can be supported by bazel 9.0.0
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Thu, 22 Jan 2026 21:23:17 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 178:94705b5986b3 | 179:8d17f6e6e290 |
|---|---|
| 1 #!/usr/bin/env bash | |
| 2 | |
| 3 echo "Test that node is added to that PATH if, and only if, it is not one already present". | |
| 4 | |
| 5 if [ -n "$EMSDK" ]; then | |
| 6 echo "EMSDK is already defined in this shell. Run tests in a shell without sourcing emsdk_env.sh first" | |
| 7 exit 1 | |
| 8 fi | |
| 9 | |
| 10 DIR=$(dirname "$BASH_SOURCE") | |
| 11 cd $DIR/.. | |
| 12 | |
| 13 ./emsdk install latest | |
| 14 ./emsdk activate latest | |
| 15 | |
| 16 if which node; then | |
| 17 echo "Test should be run without node in the path" | |
| 18 exit 1 | |
| 19 fi | |
| 20 | |
| 21 # Run emsdk_env.sh and confirm that node was added to the PATH | |
| 22 . emsdk_env.sh | |
| 23 | |
| 24 if ! which node; then | |
| 25 echo "node not found in path after emsdk_env.sh" | |
| 26 exit 1 | |
| 27 fi | |
| 28 | |
| 29 # Run emsdk_env.sh again and confirm that node is still in the PATH | |
| 30 . emsdk_env.sh | |
| 31 | |
| 32 if ! which node; then | |
| 33 echo "node not found in path after emsdk_env.sh" | |
| 34 exit 1 | |
| 35 fi |