From 5f4e1e18ee24b82cea5b2d43ce22657823ab6cd1 Mon Sep 17 00:00:00 2001 From: Daniel Barber Date: Tue, 23 Apr 2019 08:57:56 -0400 Subject: [PATCH] Change shell --- lib/shell.sh | 9 +++++++++ setup.sh | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100755 lib/shell.sh diff --git a/lib/shell.sh b/lib/shell.sh new file mode 100755 index 0000000..e67e064 --- /dev/null +++ b/lib/shell.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +SHELL_PATH=$(command -v zsh) + +if ! grep "$SHELL_PATH" /etc/shells > /dev/null 2>&1 ; then + sudo sh -c "echo $SHELL_PATH >> /etc/shells" +fi + +sudo chsh -s "$SHELL_PATH" "$USER" diff --git a/setup.sh b/setup.sh index e0466f3..daa8115 100755 --- a/setup.sh +++ b/setup.sh @@ -12,6 +12,9 @@ step() { echo "${YELLOW}❯❯❯ ${WHITE}${BOLD}$1${NC} ${YELLOW}❮❮❮${NC}" } +# Ask for the administrator password upfront +sudo -v + # Generate an SSH key if one does not already exist if [ ! -f "$HOME/.ssh/id_ed25519.pub" ]; then step "Generating SSH key" @@ -54,6 +57,10 @@ brew bundle --file="$MAC_SETUP_DIR/Brewfile" step "Installing dotfiles" "$MAC_SETUP_DIR/lib/dotfiles.sh" +# Change the shell +step "Changing shell to zsh" +"$MAC_SETUP_DIR/lib/shell.sh" + # Setup git author step "Set git author" "$MAC_SETUP_DIR/lib/git_author.sh"