Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
e8716cb5
Unverified
Commit
e8716cb5
authored
Mar 15, 2021
by
Marc Cornellà
Browse files
fix(uninstall): fix renaming .zshrc when no original rc file found
Fixes #9629 Fixes #9700
parent
3bb5e977
Changes
1
Show whitespace changes
Inline
Side-by-side
tools/uninstall.sh
View file @
e8716cb5
...
@@ -9,20 +9,20 @@ if [ -d ~/.oh-my-zsh ]; then
...
@@ -9,20 +9,20 @@ if [ -d ~/.oh-my-zsh ]; then
rm
-rf
~/.oh-my-zsh
rm
-rf
~/.oh-my-zsh
fi
fi
echo
"Looking for original zsh config..."
if
[
-e
~/.zshrc
]
;
then
ZSHRC_ORIG
=
~/.zshrc.pre-oh-my-zsh
if
[
-e
"
$ZSHRC_ORIG
"
]
;
then
echo
"Found
$ZSHRC_ORIG
-- Restoring to ~/.zshrc"
if
[
-e
~/.zshrc
]
;
then
ZSHRC_SAVE
=
~/.zshrc.omz-uninstalled-
$(
date
+%Y-%m-%d_%H-%M-%S
)
ZSHRC_SAVE
=
~/.zshrc.omz-uninstalled-
$(
date
+%Y-%m-%d_%H-%M-%S
)
echo
"Found ~/.zshrc -- Renaming to
${
ZSHRC_SAVE
}
"
echo
"Found ~/.zshrc -- Renaming to
${
ZSHRC_SAVE
}
"
mv
~/.zshrc
"
${
ZSHRC_SAVE
}
"
mv
~/.zshrc
"
${
ZSHRC_SAVE
}
"
fi
fi
echo
"Looking for original zsh config..."
ZSHRC_ORIG
=
~/.zshrc.pre-oh-my-zsh
if
[
-e
"
$ZSHRC_ORIG
"
]
;
then
echo
"Found
$ZSHRC_ORIG
-- Restoring to ~/.zshrc"
mv
"
$ZSHRC_ORIG
"
~/.zshrc
mv
"
$ZSHRC_ORIG
"
~/.zshrc
echo
"Your original zsh config was restored."
echo
"Your original zsh config was restored."
else
echo
"No original zsh config found"
fi
fi
if
hash
chsh
>
/dev/null 2>&1
&&
[
-f
~/.shell.pre-oh-my-zsh
]
;
then
if
hash
chsh
>
/dev/null 2>&1
&&
[
-f
~/.shell.pre-oh-my-zsh
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment