flocon/dot_config/fish/functions/_nvm_index_update.fish
Anthony Rodriguez dc7ee4d021 Add .config/fish/functions/_fzf_configure_bindings_help.fish
Add .config/fish/functions/_fzf_extract_var_info.fish
Add .config/fish/functions/_fzf_preview_changed_file.fish
Add .config/fish/functions/_fzf_preview_file.fish
Add .config/fish/functions/_fzf_report_diff_type.fish
Add .config/fish/functions/_fzf_report_file_type.fish
Add .config/fish/functions/_fzf_search_directory.fish
Add .config/fish/functions/_fzf_search_git_log.fish
Add .config/fish/functions/_fzf_search_git_status.fish
Add .config/fish/functions/_fzf_search_history.fish
Add .config/fish/functions/_fzf_search_processes.fish
Add .config/fish/functions/_fzf_search_variables.fish
Add .config/fish/functions/_fzf_wrapper.fish
Add .config/fish/functions/_nvm_index_update.fish
Add .config/fish/functions/_nvm_list.fish
Add .config/fish/functions/_nvm_version_activate.fish
Add .config/fish/functions/_nvm_version_deactivate.fish
Add .config/fish/functions/fish_greeting.fish
Add .config/fish/functions/fish_mode_prompt.fish
Add .config/fish/functions/fish_title.fish
Add .config/fish/functions/fzf_configure_bindings.fish
Add .config/fish/functions/nvm.fish
2024-06-07 11:48:47 +02:00

20 lines
584 B
Fish

function _nvm_index_update
test ! -d $nvm_data && command mkdir -p $nvm_data
set --local index $nvm_data/.index
if not command curl -q --location --silent $nvm_mirror/index.tab >$index.temp
command rm -f $index.temp
echo "nvm: Can't update index, host unavailable: \"$nvm_mirror\"" >&2
return 1
end
command awk -v OFS=\t '
/v0.9.12/ { exit } # Unsupported
NR > 1 {
print $1 (NR == 2 ? " latest" : $10 != "-" ? " lts/" tolower($10) : "")
}
' $index.temp >$index
command rm -f $index.temp
end