feat(modules): 添加 zsh 默认 shell 自动设置
This commit is contained in:
@@ -3,3 +3,5 @@ description: Zsh 及插件
|
|||||||
dotfiles:
|
dotfiles:
|
||||||
- source: dotfiles/.zshrc
|
- source: dotfiles/.zshrc
|
||||||
target: ~/.zshrc
|
target: ~/.zshrc
|
||||||
|
post_install_hook: scripts/set-default-shell.sh
|
||||||
|
hook_behavior: once
|
||||||
|
|||||||
Executable
+10
@@ -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
|
||||||
Reference in New Issue
Block a user