mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-17 04:29:14 +02:00
fix(uninstaller): respect $ZDOTDIR and $ZSH variables
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 #11466
Closes #10537
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
7c10d9839f
commit
01e779a4d3
2 changed files with 59 additions and 16 deletions
|
|
@ -5,7 +5,7 @@ function zsh_stats() {
|
|||
}
|
||||
|
||||
function uninstall_oh_my_zsh() {
|
||||
command env ZSH="$ZSH" sh "$ZSH/tools/uninstall.sh"
|
||||
command env ZSH="$ZSH" ZDOTDIR="${ZDOTDIR:-}" sh "$ZSH/tools/uninstall.sh"
|
||||
}
|
||||
|
||||
function upgrade_oh_my_zsh() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue