Skip to content

Commit 690b0fb

Browse files
authored
fix(install-macos): ensure zsh is added to /etc/shells before changing the default shell
1 parent bb0a3d1 commit 690b0fb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

bin/install-macos.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ get_dotfiles() {
4040
install_oh_my_zsh() {
4141
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
4242

43-
chsh -s /bin/zsh "${USER}"
43+
if ! grep -qx "$(which zsh)" /etc/shells; then
44+
sudo sh -c "echo $(which zsh) >> /etc/shells"
45+
fi
46+
47+
chsh -s "$(which zsh)" "$USER"
4448
}
4549

4650
install_all() {

0 commit comments

Comments
 (0)