Skip to content

Commit 717ebda

Browse files
committed
Prevent a warning in ruby-wasm-emscripten/build-package.sh
The PATH environment variable introduced emsdk has a directory named `node`, which caused the following error: ``` ./build-package.sh: line 22: /home/runner/work/emirb/emirb/emsdk/node: Is a directory ./build-package.sh: line 23: [: : integer expression expected ``` This change checks the version of "$dir/node" only when it is a file, not a directory.
1 parent 38070b9 commit 717ebda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/npm-packages/ruby-wasm-emscripten/build-package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ find_compatible_node() {
1818
# Find `node` executable (>= 15) in PATH
1919
IFS=':' read -ra dirs <<< "$PATH"
2020
for dir in "${dirs[@]}"; do
21-
if [ -x "$dir/node" ]; then
21+
if [ -f "$dir/node" ] && [ -x "$dir/node" ]; then
2222
node_version=$("$dir/node" --version)
2323
if [ "${node_version:1:2}" -ge 15 ]; then
2424
echo "$dir/node"

0 commit comments

Comments
 (0)