2024-01-27 21:15:25 -08:00
|
|
|
#!/usr/bin/env sh
|
2024-01-25 18:19:27 -08:00
|
|
|
|
2024-01-27 21:15:25 -08:00
|
|
|
DOT="${DOT:-$HOME/dotfiles}"
|
|
|
|
|
|
|
|
# shellcheck source=../homebrew/brew_utils.sh
|
|
|
|
. "$DOT/homebrew/brew_utils.sh"
|
|
|
|
# shellcheck source=../script/utils.sh
|
|
|
|
. "$DOT/script/utils.sh"
|
2024-01-25 18:19:27 -08:00
|
|
|
|
2024-02-03 12:05:02 -08:00
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2024-01-25 18:19:27 -08:00
|
|
|
|
|
|
|
brew_install "Fish Shell" "fish"
|
|
|
|
|
|
|
|
fish_path="$(which fish)"
|
|
|
|
|
2024-02-03 12:05:02 -08:00
|
|
|
if ! grep "$fish_path" </etc/shells >/dev/null 2>&1; then
|
2024-01-25 18:19:27 -08:00
|
|
|
execute \
|
|
|
|
"printf '%s\n' '$fish_path' | sudo tee -a /etc/shells" \
|
|
|
|
"Add '$fish_path' to '/etc/shells'"
|
|
|
|
fi
|
|
|
|
|
2024-01-27 21:15:25 -08:00
|
|
|
chsh -s "$fish_path" >/dev/null 2>&1
|
2024-01-25 18:19:27 -08:00
|
|
|
print_result $? "Make OS use Fish as the default shell"
|