comparison third_party/emsdk/test/test_node_path.sh @ 186:8cf4ec5e2191 hg-web

Fixed merge conflict.
author MrJuneJune <me@mrjunejune.com>
date Fri, 23 Jan 2026 22:38:59 -0800
parents 8d17f6e6e290
children
comparison
equal deleted inserted replaced
176:fed99fc04e12 186:8cf4ec5e2191
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