-
-
Save jukben/9b8003155295b03539c48f57d43ecd24 to your computer and use it in GitHub Desktop.
/usr/local/bin/node
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
#!/usr/bin/env fish | |
# Get the current Node.js version managed by nvm.fish | |
set nvm_current_version (nvm current) | |
# Check if a Node.js version is currently selected | |
if test "$nvm_current_version" = "none" | |
echo "Error: No Node.js version selected. Please use 'nvm use' to select a version." | |
exit 1 | |
end | |
# Build the path to the Node.js binary | |
set node_bin "$nvm_data/$nvm_current_version/bin/node" | |
# Check if the Node.js binary exists and is executable | |
if not test -x "$node_bin" | |
echo "Error: Node.js binary not found at $node_bin" | |
exit 1 | |
end | |
# Execute Node.js with any passed arguments | |
exec "$node_bin" $argv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment