mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-10 16:32:00 +00:00
feat(installer): add specific flag to skip Zsh execution after installation
This flag would skip executing a Zsh subshell without forcingly use --unattended, allowing the user to still choose to change the default shell and overwrite the current .zshrc file at users's $HOME. This flag is compatible with other established ways to skip running a Zsh subshell, like `RUNZSH=yes sh -c "$(<fetch_OMZ_installer_command>)`, or `--unattended`, as noted in PR #5853 (https://github.com/ohmyzsh/ohmyzsh/pull/5853#issuecomment-496625733)
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
#
|
#
|
||||||
# You can also pass some arguments to the install script to set some these options:
|
# You can also pass some arguments to the install script to set some these options:
|
||||||
# --skip-chsh: has the same behavior as setting CHSH to 'no'
|
# --skip-chsh: has the same behavior as setting CHSH to 'no'
|
||||||
|
# --skip-runzsh: has the same behavior as setting RUNZSH to 'no'
|
||||||
# --unattended: sets both CHSH and RUNZSH to 'no'
|
# --unattended: sets both CHSH and RUNZSH to 'no'
|
||||||
# --keep-zshrc: sets KEEP_ZSHRC to 'yes'
|
# --keep-zshrc: sets KEEP_ZSHRC to 'yes'
|
||||||
# For example:
|
# For example:
|
||||||
@@ -343,7 +344,7 @@ setup_zshrc() {
|
|||||||
echo "${FMT_YELLOW}Found ${zdot}/.zshrc.${FMT_RESET} ${FMT_GREEN}Keeping...${FMT_RESET}"
|
echo "${FMT_YELLOW}Found ${zdot}/.zshrc.${FMT_RESET} ${FMT_GREEN}Keeping...${FMT_RESET}"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $OVERWRITE_CONFIRMATION != "no" ]; then
|
if [ $OVERWRITE_CONFIRMATION != "no" ]; then
|
||||||
# Ask user for confirmation before backing up and overwriting
|
# Ask user for confirmation before backing up and overwriting
|
||||||
echo "${FMT_YELLOW}Found ${zdot}/.zshrc."
|
echo "${FMT_YELLOW}Found ${zdot}/.zshrc."
|
||||||
@@ -522,6 +523,7 @@ main() {
|
|||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
--unattended) RUNZSH=no; CHSH=no; OVERWRITE_CONFIRMATION=no ;;
|
--unattended) RUNZSH=no; CHSH=no; OVERWRITE_CONFIRMATION=no ;;
|
||||||
|
--skip-runzsh) RUNZSH=no ;;
|
||||||
--skip-chsh) CHSH=no ;;
|
--skip-chsh) CHSH=no ;;
|
||||||
--keep-zshrc) KEEP_ZSHRC=yes ;;
|
--keep-zshrc) KEEP_ZSHRC=yes ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user