The uninstaller hardcodes ~/.oh-my-zsh and ~/.zshrc, which fails for
users who set $ZDOTDIR or installed to a custom $ZSH path. The
installer already handles these variables (tools/install.sh line 62),
but the uninstaller does not, leaving files behind or removing the
wrong directory.
Use ${ZDOTDIR:-$HOME} and ${ZSH:-$HOME/.oh-my-zsh} to match the
installer's conventions. Also pass ZDOTDIR through the env wrapper
in uninstall_oh_my_zsh() so it is available to the sh subprocess.
Closes#11466Closes#10537
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
If there's no `~/.shell.pre-oh-my-zsh`, don't assume the default choice
is Bash. In fact Zsh is the default shell for macOS since Catalina
(10.15) [1], yet users of other OSes have likely to have Bash as their
default.
This commit fix issue #8252
[1] https://support.apple.com/en-us/HT208050
* Balk at incompatible Windows/MSYS git
* Test for chsh presence before trying to use it
* Replace non-portable `[[ ... ]]` and `[ x = *pattern* ]` constructs