mirror of
https://github.com/ivuorinen/nvm-auto-use.fish.git
synced 2026-03-13 00:01:26 +00:00
feat: multiple improvements, additions, vibin'
This commit is contained in:
26
functions/nvm_version_prompt.fish
Normal file
26
functions/nvm_version_prompt.fish
Normal file
@@ -0,0 +1,26 @@
|
||||
function nvm_version_prompt -d "Display current Node.js version for prompt integration"
|
||||
if command -q node
|
||||
set -l version (node -v 2>/dev/null | string replace 'v' '')
|
||||
if test -n "$version"
|
||||
echo "⬢ $version"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function nvm_version_status -d "Show detailed Node.js version status"
|
||||
if command -q node
|
||||
set -l version (node -v 2>/dev/null)
|
||||
set -l npm_version (npm -v 2>/dev/null)
|
||||
|
||||
echo "Node.js: $version"
|
||||
if test -n "$npm_version"
|
||||
echo "npm: v$npm_version"
|
||||
end
|
||||
|
||||
if set -q _nvm_auto_use_cached_file
|
||||
echo "Auto-use: $_nvm_auto_use_cached_file"
|
||||
end
|
||||
else
|
||||
echo "Node.js: not installed"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user