github.com/pion/webrtc/v3@v3.2.24/test-wasm/go_js_wasm_exec (about) 1 #!/bin/bash 2 # SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly> 3 # SPDX-FileCopyrightText: 2019 Alex Browne 4 # SPDX-License-Identifier: MIT 5 6 # Check Node.js version 7 if [[ $(node --version) =~ v[0-9]\. ]] 8 then 9 echo "Node.js version >= 10 is required" 10 exit 1 11 fi 12 13 SOURCE="${BASH_SOURCE[0]}" 14 while [ -h "$SOURCE" ]; do 15 DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 16 SOURCE="$(readlink "$SOURCE")" 17 [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" 18 done 19 DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 20 21 NODE_WASM_EXEC="$(go env GOROOT)/misc/wasm/wasm_exec_node.js" 22 WASM_EXEC="$(go env GOROOT)/misc/wasm/wasm_exec.js" 23 24 if test -f "$NODE_WASM_EXEC"; then 25 exec node --require="${DIR}/node_shim.js" "$NODE_WASM_EXEC" "$@" 26 else 27 exec node --require="${DIR}/node_shim.js" "$WASM_EXEC" "$@" 28 fi 29 30