Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
c08b925d
Unverified
Commit
c08b925d
authored
Mar 23, 2023
by
Michele Bologna
Committed by
GitHub
Mar 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(uninstall): abort uninstall if unable to change shell (#10357)
parent
5efcfc39
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
uninstall.sh
tools/uninstall.sh
+12
-11
No files found.
tools/uninstall.sh
View file @
c08b925d
if
hash
chsh
>
/dev/null 2>&1
&&
[
-f
~/.shell.pre-oh-my-zsh
]
;
then
old_shell
=
$(
cat
~/.shell.pre-oh-my-zsh
)
echo
"Switching your shell back to '
$old_shell
':"
if
chsh
-s
"
$old_shell
"
;
then
rm
-f
~/.shell.pre-oh-my-zsh
else
echo
"Could not change default shell. Change it manually by running chsh"
echo
"or editing the /etc/passwd file."
exit
fi
fi
read
-r
-p
"Are you sure you want to remove Oh My Zsh? [y/N] "
confirmation
if
[
"
$confirmation
"
!=
y
]
&&
[
"
$confirmation
"
!=
Y
]
;
then
echo
"Uninstall cancelled"
...
...
@@ -25,16 +37,5 @@ else
echo
"No original zsh config found"
fi
if
hash
chsh
>
/dev/null 2>&1
&&
[
-f
~/.shell.pre-oh-my-zsh
]
;
then
old_shell
=
$(
cat
~/.shell.pre-oh-my-zsh
)
echo
"Switching your shell back to '
$old_shell
':"
if
chsh
-s
"
$old_shell
"
;
then
rm
-f
~/.shell.pre-oh-my-zsh
else
echo
"Could not change default shell. Change it manually by running chsh"
echo
"or editing the /etc/passwd file."
fi
fi
echo
"Thanks for trying out Oh My Zsh. It's been uninstalled."
echo
"Don't forget to restart your terminal!"
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