From c32e8b4015526267a70f7e8052fef4b05c984c7a Mon Sep 17 00:00:00 2001 From: laily Date: Tue, 26 May 2026 13:07:40 +0800 Subject: [PATCH] feat: add mise config --- mise/config.toml | 8 ++++++++ script/mise-install.sh | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 mise/config.toml diff --git a/mise/config.toml b/mise/config.toml new file mode 100644 index 0000000..6f418b9 --- /dev/null +++ b/mise/config.toml @@ -0,0 +1,8 @@ +[tools] +fzf = "latest" +go = "1.25" +neovim = "latest" +opencode = "latest" +python = "3.13" +ripgrep = "latest" +"github:hilaily/agent-notify" = { version = "latest", rename_exe = "agent-notify" } diff --git a/script/mise-install.sh b/script/mise-install.sh index 2cac49a..e529f65 100755 --- a/script/mise-install.sh +++ b/script/mise-install.sh @@ -35,6 +35,27 @@ else mise --version fi +# 链接 dotfile 中的 mise 配置 +MISE_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/mise" +DOTFILE_MISE_CONFIG="$HOME/.dotfile/mise/config.toml" +mkdir -p "$MISE_CONFIG_DIR" +if [ -f "$DOTFILE_MISE_CONFIG" ]; then + if [ -f "$MISE_CONFIG_DIR/config.toml" ] && [ ! -L "$MISE_CONFIG_DIR/config.toml" ]; then + mv "$MISE_CONFIG_DIR/config.toml" "$MISE_CONFIG_DIR/config.toml.bak" + echo -e "${YELLOW}已备份原有配置到 config.toml.bak${NC}" + fi + ln -sf "$DOTFILE_MISE_CONFIG" "$MISE_CONFIG_DIR/config.toml" + echo -e "${GREEN}已链接 mise 配置: $MISE_CONFIG_DIR/config.toml${NC}" + mise trust "$DOTFILE_MISE_CONFIG" 2>/dev/null || true +fi + +# 安装配置中的工具 +if command -v mise &> /dev/null && [ -f "$MISE_CONFIG_DIR/config.toml" ]; then + echo -e "${YELLOW}正在安装 mise 工具...${NC}" + mise install + echo -e "${GREEN}mise 工具安装完成${NC}" +fi + # 验证安装 if command -v mise &> /dev/null then