diff options
| author | Marc Cornellà <marc.cornella@live.com> | 2019-05-27 22:58:33 +0200 | 
|---|---|---|
| committer | Marc Cornellà <marc.cornella@live.com> | 2019-06-03 17:18:25 +0200 | 
| commit | 1cf42a506ff55d12c3246239332469d193bbf4b1 (patch) | |
| tree | 4bb1f8cbaeaf093847388f1305eaee036dbd7ed4 /tools | |
| parent | a40d93295f91d1553522e58433e0ba2c4186d2b8 (diff) | |
| download | zsh-1cf42a506ff55d12c3246239332469d193bbf4b1.tar.gz zsh-1cf42a506ff55d12c3246239332469d193bbf4b1.tar.bz2 zsh-1cf42a506ff55d12c3246239332469d193bbf4b1.zip | |
installer: add option to not run zsh at the end
Co-authored-by: Liquidsoul <liquidsoul@liquidsoul.fr>
Co-authored-by: Alexander Polynomdivision <digitalmail555@googlemail.com>
Co-authored-by: loket <loket@cruftlab.io>
Co-authored-by: Connor Demille <subtlepseudonym@gmail.com>
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/install.sh | 14 | 
1 files changed, 11 insertions, 3 deletions
| diff --git a/tools/install.sh b/tools/install.sh index 2d2936531..9eb83cfbd 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -15,7 +15,8 @@  #   REMOTE  - full remote URL of the git repo to install (default: GitHub via HTTPS)  #   BRANCH  - branch to check out immediately after install (default: master)  # Other options: -#   CHSH    - set to no tells the installer not to change the default shell (default: yes) +#   CHSH    - 'no' means the installer will not change the default shell (default: yes) +#   RUNZSH  - 'no' means the installer will not run zsh after the install (default: yes)  #  set -e @@ -27,6 +28,7 @@ BRANCH=${BRANCH:-master}  # Other options  CHSH=${CHSH:-yes} +RUNZSH=${RUNZSH:-yes}  command_exists() { @@ -126,7 +128,7 @@ export ZSH=\"$ZSH\"  setup_shell() {  	# Skip setup if the user wants or stdin is closed (not running interactively). -	if [ $CHSH = no ] || ! [ -t 0 ]; then +	if [ $CHSH = no ]; then  		return  	fi @@ -173,9 +175,15 @@ setup_shell() {  }  main() { +	if [ ! -t 0 ]; then +		RUNZSH=no +		CHSH=no +	fi +  	# Parse arguments  	while [ $# -gt 0 ]; do  		case $1 in +			--silent|--batch) RUNZSH=no; CHSH=no ;;  			--skip-chsh) CHSH=no ;;  		esac  		shift @@ -219,7 +227,7 @@ main() {  	EOF  	printf "$RESET" -	if [ ! -t 0 ]; then +	if [ $RUNZSH = no ]; then  		echo "${YELLOW}Run zsh to try it out.${RESET}"  		exit  	fi | 
