Files
.dotfile/script/nvm-install.sh
T
laily 67291a9a50 feat: add script catalog and -h help for all dotfile scripts
Introduce ff script -h with auto descriptions, shared help.sh, and usage flags across script/*.sh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 15:09:35 +08:00

32 lines
687 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 安装 fnm(Node 版本管理)并 reload fish 配置
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck disable=SC1091
source "$SCRIPT_DIR/common/help.sh"
usage() {
cat <<'EOF'
用法: nvm-install
通过 fnm 官方安装脚本安装 Fast Node Manager,并执行 ff reload。
选项:
-h, --help 显示此帮助
说明: 本仓库 fish 配置中 nvm 别名指向 fnm。
EOF
}
dotfile_help_requested "${1:-}" && dotfile_show_help
set -euo pipefail
curl -fsSL https://fnm.vercel.app/install | bash
if command -v ff &>/dev/null; then
ff reload
elif command -v fish &>/dev/null; then
fish -c "source ~/.config/fish/config.fish"
fi