feat: add mise config

This commit is contained in:
2026-05-26 13:07:40 +08:00
parent 137e67503a
commit c32e8b4015
2 changed files with 29 additions and 0 deletions
+8
View File
@@ -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" }
+21
View File
@@ -35,6 +35,27 @@ else
mise --version mise --version
fi 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 if command -v mise &> /dev/null
then then