feat(modules): 添加 zsh 默认 shell 自动设置

This commit is contained in:
2026-03-25 16:19:55 +08:00
parent 67fc622926
commit efa5fd835c
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -3,3 +3,5 @@ description: Zsh 及插件
dotfiles:
- source: dotfiles/.zshrc
target: ~/.zshrc
post_install_hook: scripts/set-default-shell.sh
hook_behavior: once
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
set -euo pipefail
if [ "$SHELL" != "$(which zsh)" ]; then
echo "==> 设置默认 shell 为 zsh..."
sudo chsh -s "$(which zsh)" "$USER"
echo "✓ 默认 shell 已设置为 zsh(重新登录后生效)"
else
echo "默认 shell 已经是 zsh"
fi