mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-12 21:39:48 +01:00
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>
This commit is contained in:
parent
a40d93295f
commit
1cf42a506f
1 changed files with 11 additions and 3 deletions
|
@ -15,7 +15,8 @@
|
||||||
# REMOTE - full remote URL of the git repo to install (default: GitHub via HTTPS)
|
# REMOTE - full remote URL of the git repo to install (default: GitHub via HTTPS)
|
||||||
# BRANCH - branch to check out immediately after install (default: master)
|
# BRANCH - branch to check out immediately after install (default: master)
|
||||||
# Other options:
|
# 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
|
set -e
|
||||||
|
|
||||||
|
@ -27,6 +28,7 @@ BRANCH=${BRANCH:-master}
|
||||||
|
|
||||||
# Other options
|
# Other options
|
||||||
CHSH=${CHSH:-yes}
|
CHSH=${CHSH:-yes}
|
||||||
|
RUNZSH=${RUNZSH:-yes}
|
||||||
|
|
||||||
|
|
||||||
command_exists() {
|
command_exists() {
|
||||||
|
@ -126,7 +128,7 @@ export ZSH=\"$ZSH\"
|
||||||
|
|
||||||
setup_shell() {
|
setup_shell() {
|
||||||
# Skip setup if the user wants or stdin is closed (not running interactively).
|
# Skip setup if the user wants or stdin is closed (not running interactively).
|
||||||
if [ $CHSH = no ] || ! [ -t 0 ]; then
|
if [ $CHSH = no ]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -173,9 +175,15 @@ setup_shell() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
if [ ! -t 0 ]; then
|
||||||
|
RUNZSH=no
|
||||||
|
CHSH=no
|
||||||
|
fi
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
--silent|--batch) RUNZSH=no; CHSH=no ;;
|
||||||
--skip-chsh) CHSH=no ;;
|
--skip-chsh) CHSH=no ;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
|
@ -219,7 +227,7 @@ main() {
|
||||||
EOF
|
EOF
|
||||||
printf "$RESET"
|
printf "$RESET"
|
||||||
|
|
||||||
if [ ! -t 0 ]; then
|
if [ $RUNZSH = no ]; then
|
||||||
echo "${YELLOW}Run zsh to try it out.${RESET}"
|
echo "${YELLOW}Run zsh to try it out.${RESET}"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue