dotfiles/fish/setup.sh

31 lines
672 B
Bash
Executable File

#!/usr/bin/env bash
source ${DOTFILES}/helpers.sh
function main()
{
print_info "Installing fish shell"
# Install fish shell
brewget fish
# Add to list of shells and set as default
if ! grep /usr/local/bin/fish < /etc/shells >/dev/null; then
echo /usr/local/bin/fish | sudo tee -a /etc/shells
chsh -s /usr/local/bin/fish
fi
# Install configuration files
makedir ${HOME}/.config
if ! head -n 1 ${DOTFILES}/fish/config.fish | grep ${DOTFILES} >/dev/null; then
sed -i '' "1s;.*;set -x DOTFILES ${DOTFILES};" ${DOTFILES}/fish/config.fish
fi
linkfile ${DOTFILES}/fish ${HOME}/.config/fish
print_ok "Fish shell installed"
}
main "$@"