···5353 # Scripts have descriptions appended with a tab separator.
5454 # Strip off descriptions for the purposes of subcommand testing.
5555 set -l scripts (__fish__get_bun_scripts)
5656- if __fish_seen_subcommand_from $(string split \t -f 1 -- $scripts)
5656+ if __fish_seen_subcommand_from (string split \t -f 1 -- $scripts)
5757 return
5858 end
5959 # Emit scripts.
-21
fish/completions/nvm.fish
···11-complete --command nvm --exclusive
22-complete --command nvm --exclusive --long version --description "Print version"
33-complete --command nvm --exclusive --long help --description "Print help"
44-complete --command nvm --long silent --description "Suppress standard output"
55-66-complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version"
77-complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate the specified Node version in the current shell"
88-complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed Node versions"
99-complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List available Node versions to install"
1010-complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active Node version"
1111-complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
1212- test -e $nvm_data && string split ' ' <$nvm_data/.index
1313-)"
1414-complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')"
1515-complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall the specified Node version"
1616-complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
1717- _nvm_list | string split ' ' | string replace system ''
1818-)"
1919-complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" --arguments "(
2020- set --query nvm_default_version && echo default
2121-)"
+34-10
fish/config.fish
···11/home/linuxbrew/.linuxbrew/bin/brew shellenv | source
2233-fish_add_path /home/vpb/.local/bin
33+fish_add_path /home/vitorpy/.local/bin
44+55+set NODE_OPTIONS --max-old-space-size=8192
66+77+# Created by `pipx` on 2024-04-12 12:49:16
88+set PATH $PATH /home/vitorpy/.local/bin
99+set OMAKUB_PATH /home/vitorpy/.local/share/omakub
1010+1111+# bun
1212+set BUN_INSTALL "$HOME/.bun"
1313+set PATH $BUN_INSTALL/bin $PATH
1414+1515+# Android SDK
1616+set PATH $PATH /home/vitorpy/Android/Sdk/platform-tools
1717+1818+set ANTHROPIC_API_KEY "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"
419520if status is-interactive
621 set fish_greeting
722 set EDITOR nvim
2323+ set GTK_THEME "Yaru:dark"
2424+ set HOMEBREW_NO_ENV_HINTS
2525+ set QT_QPA_PLATFORMTHEME gnome
2626+ set QT_STYLE_OVERRIDE Adwaita-Dark
2727+828929 # Commands to run in interactive sessions can go here
1030 starship init fish | source
1131 direnv hook fish | source
1212- nvm use latest
1332end
14333434+export NARGO_HOME="/home/vitorpy/.nargo"
15351616-# Created by `pipx` on 2024-04-12 12:49:16
1717-set PATH $PATH /home/vitorpy/.local/bin
3636+# NVM Setup
3737+set -x NVM_DIR ~/.nvm
18381919-# bun
2020-set --export BUN_INSTALL "$HOME/.bun"
2121-set --export PATH $BUN_INSTALL/bin $PATH
3939+# Load nvm automatically if it exists
4040+if test -e ~/.nvm/nvm.sh
4141+ load_nvm
4242+end
22432323-set ANTHROPIC_API_KEY "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"
4444+# pnpm
4545+set -gx PNPM_HOME "/home/vitorpy/.local/share/pnpm"
4646+if not string match -q -- $PNPM_HOME $PATH
4747+ set -gx PATH "$PNPM_HOME" $PATH
4848+end
4949+# pnpm end
24502525-# The next line updates PATH for the Google Cloud SDK.
2626-if [ -f '/home/vitorpy/google-cloud-sdk/path.fish.inc' ]; . '/home/vitorpy/google-cloud-sdk/path.fish.inc'; end
···11-function nvm --description "Node version manager"
22- for silent in --silent -s
33- if set --local index (contains --index -- $silent $argv)
44- set --erase argv[$index] && break
55- end
66- set --erase silent
77- end
88-99- set --local cmd $argv[1]
1010- set --local ver $argv[2]
1111-1212- if set --query silent && ! set --query cmd[1]
1313- echo "nvm: Version number not specified (see nvm -h for usage)" >&2
1414- return 1
1515- end
1616-1717- if ! set --query ver[1] && contains -- "$cmd" install use
1818- for file in .nvmrc .node-version
1919- set file (_nvm_find_up $PWD $file) && read ver <$file && break
2020- end
2121-2222- if ! set --query ver[1]
2323- echo "nvm: Invalid version or missing \".nvmrc\" file" >&2
2424- return 1
2525- end
2626- end
2727-2828- set --local their_version $ver
2929-3030- switch "$cmd"
3131- case -v --version
3232- echo "nvm, version 2.2.13"
3333- case "" -h --help
3434- echo "Usage: nvm install <version> Download and activate the specified Node version"
3535- echo " nvm install Install the version specified in the nearest .nvmrc file"
3636- echo " nvm use <version> Activate the specified Node version in the current shell"
3737- echo " nvm use Activate the version specified in the nearest .nvmrc file"
3838- echo " nvm list List installed Node versions"
3939- echo " nvm list-remote List available Node versions to install"
4040- echo " nvm list-remote <regex> List Node versions matching a given regex pattern"
4141- echo " nvm current Print the currently-active Node version"
4242- echo " nvm uninstall <version> Uninstall the specified Node version"
4343- echo "Options:"
4444- echo " -s, --silent Suppress standard output"
4545- echo " -v, --version Print the version of nvm"
4646- echo " -h, --help Print this help message"
4747- echo "Variables:"
4848- echo " nvm_arch Override architecture, e.g. x64-musl"
4949- echo " nvm_mirror Use a mirror for downloading Node binaries"
5050- echo " nvm_default_version Set the default version for new shells"
5151- echo " nvm_default_packages Install a list of packages every time a Node version is installed"
5252- echo "Examples:"
5353- echo " nvm install latest Install the latest version of Node"
5454- echo " nvm use 14.15.1 Use Node version 14.15.1"
5555- echo " nvm use system Activate the system's Node version"
5656-5757- case install
5858- _nvm_index_update
5959-6060- string match --entire --regex -- (_nvm_version_match $ver) <$nvm_data/.index | read ver alias
6161-6262- if ! set --query ver[1]
6363- echo "nvm: Invalid version number or alias: \"$their_version\"" >&2
6464- return 1
6565- end
6666-6767- if test ! -e $nvm_data/$ver
6868- set --local os (command uname -s | string lower)
6969- set --local ext tar.gz
7070- set --local arch (command uname -m)
7171-7272- switch $os
7373- case aix
7474- set arch ppc64
7575- case sunos
7676- case linux
7777- case darwin
7878- case {MSYS_NT,MINGW\*_NT}\*
7979- set os win
8080- set ext zip
8181- case \*
8282- echo "nvm: Unsupported operating system: \"$os\"" >&2
8383- return 1
8484- end
8585-8686- switch $arch
8787- case i\*86
8888- set arch x86
8989- case x86_64
9090- set arch x64
9191- case arm64
9292- string match --regex --quiet "v(?<major>\d+)" $ver
9393- if test "$os" = darwin -a $major -lt 16
9494- set arch x64
9595- end
9696- case armv6 armv6l
9797- set arch armv6l
9898- case armv7 armv7l
9999- set arch armv7l
100100- case armv8 armv8l aarch64
101101- set arch arm64
102102- end
103103-104104- set --query nvm_arch && set arch $nvm_arch
105105-106106- set --local dir "node-$ver-$os-$arch"
107107- set --local url $nvm_mirror/$ver/$dir.$ext
108108-109109- command mkdir -p $nvm_data/$ver
110110-111111- if ! set --query silent
112112- echo -e "Installing Node \x1b[1m$ver\x1b[22m $alias"
113113- echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m"
114114- end
115115-116116- if ! command curl $silent --progress-bar --location $url |
117117- command tar --extract --gzip --directory $nvm_data/$ver 2>/dev/null
118118- command rm -rf $nvm_data/$ver
119119- echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2
120120- return 1
121121- end
122122-123123- set --query silent || echo -en "\033[F\33[2K\x1b[0m"
124124-125125- if test "$os" = win
126126- command mv $nvm_data/$ver/$dir $nvm_data/$ver/bin
127127- else
128128- command mv $nvm_data/$ver/$dir/* $nvm_data/$ver
129129- command rm -rf $nvm_data/$ver/$dir
130130- end
131131- end
132132-133133- if test $ver != "$nvm_current_version"
134134- set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
135135- _nvm_version_activate $ver
136136-137137- set --query nvm_default_packages[1] && npm install --global $silent $nvm_default_packages
138138- end
139139-140140- set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
141141- case use
142142- test $ver = default && set ver $nvm_default_version
143143- _nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __
144144-145145- if ! set --query ver[1]
146146- echo "nvm: Can't use Node \"$their_version\", version must be installed first" >&2
147147- return 1
148148- end
149149-150150- if test $ver != "$nvm_current_version"
151151- set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
152152- test $ver != system && _nvm_version_activate $ver
153153- end
154154-155155- set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
156156- case uninstall
157157- if test -z "$ver"
158158- echo "nvm: Not enough arguments for command: \"$cmd\"" >&2
159159- return 1
160160- end
161161-162162- test $ver = default && test ! -z "$nvm_default_version" && set ver $nvm_default_version
163163-164164- _nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __
165165-166166- if ! set -q ver[1]
167167- echo "nvm: Node version not installed or invalid: \"$their_version\"" >&2
168168- return 1
169169- end
170170-171171- set --query silent || printf "Uninstalling Node %s %s\n" $ver (string replace ~ \~ "$nvm_data/$ver/bin/node")
172172-173173- _nvm_version_deactivate $ver
174174-175175- command rm -rf $nvm_data/$ver
176176- case current
177177- _nvm_current
178178- case ls list
179179- _nvm_list | _nvm_list_format (_nvm_current) $argv[2]
180180- case lsr {ls,list}-remote
181181- _nvm_index_update || return
182182- _nvm_list | command awk '
183183- FILENAME == "-" && (is_local[$1] = FNR == NR) { next } {
184184- print $0 (is_local[$1] ? " ✓" : "")
185185- }
186186- ' - $nvm_data/.index | _nvm_list_format (_nvm_current) $argv[2]
187187- case \*
188188- echo "nvm: Unknown command or option: \"$cmd\" (see nvm -h for usage)" >&2
189189- return 1
190190- end
191191-end
192192-193193-function _nvm_find_up --argument-names path file
194194- test -e "$path/$file" && echo $path/$file || begin
195195- test ! -z "$path" || return
196196- _nvm_find_up (string replace --regex -- '/[^/]*$' "" $path) $file
197197- end
198198-end
199199-200200-function _nvm_version_match --argument-names ver
201201- string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $ver |
202202- string replace --filter --regex -- '^v?(\d+)' 'v$1' |
203203- string escape --style=regex || string lower '\b'$ver'(?:/\w+)?$'
204204-end
205205-206206-function _nvm_list_format --argument-names current regex
207207- command awk -v current="$current" -v regex="$regex" '
208208- $0 ~ regex {
209209- aliases[versions[i++] = $1] = $2 " " $3
210210- pad = (n = length($1)) > pad ? n : pad
211211- }
212212- END {
213213- if (!i) exit 1
214214- while (i--)
215215- printf((current == versions[i] ? " ▶ " : " ") "%"pad"s %s\n",
216216- versions[i], aliases[versions[i]])
217217- }
218218- '
219219-end
220220-221221-function _nvm_current
222222- command --search --quiet node || return
223223- set --query nvm_current_version && echo $nvm_current_version || echo system
224224-end
225225-226226-function _nvm_node_info
227227- set --local npm_path (string replace bin/npm-cli.js "" (realpath (command --search npm)))
228228- test -f $npm_path/package.json || set --local npm_version_default (command npm --version)
229229- command node --eval "
230230- console.log(process.version)
231231- console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version)
232232- console.log(process.execPath)
233233- " | string replace -- ~ \~
11+function nvm
22+ bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv
2343end