Skip to content

Commit

Permalink
Change shell if sudo is passed as argument.
Browse files Browse the repository at this point in the history
See #52.
  • Loading branch information
flatheadmill committed Aug 28, 2019
1 parent 87c0d19 commit 140333f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ if ! { [[ "$git_version" == 2.* ]] || [[ "$git_version" == 1.[8-9].* ]] || [[ "
fi

if [ $(basename $SHELL) != "zsh" ]; then
if [[ "$OSTYPE" = "linux-gnu" ]]; then
abend "you need to: sudo usermod --shell $(which zsh) $USER"
if [[ "$1" = "sudo" ]]; then
sudo chsh -s $(which zsh) $USER
else
abend "you need to: sudo chsh -s $(which zsh) $USER"
if [[ "$OSTYPE" = "linux-gnu" ]]; then
abend "you need to: sudo usermod --shell $(which zsh) $USER"
else
abend "you need to: sudo chsh -s $(which zsh) $USER"
fi
fi
fi

Expand Down

0 comments on commit 140333f

Please sign in to comment.