install.fairie/dotfiles/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_after_20-ensure-zsh-macos.tmpl

17 lines
456 B
Bash

#!/usr/bin/env bash
# Required for PATHs (including logging)
source "$HOME/.config/shell/exports"
{{- if (not .host.restricted) }}
logg 'Ensuring ZSH is set as the default shell'
if ! grep -qc "/usr/local/bin/zsh" /etc/shells; then
echo "/usr/local/bin/zsh" | sudo tee -a /etc/shells > /dev/null
fi
{{- if eq .host.arch "arm64" }}
if [[ ! -e /usr/local/bin/zsh ]]; then
sudo ln -sf /opt/homebrew/bin/zsh /usr/local/bin/zsh
fi
{{- end -}}
{{- end }}