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
2e54ba2d
Commit
2e54ba2d
authored
Oct 13, 2017
by
Zach Whitten
Committed by
Marc Cornellà
Jun 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
installer: restore previous default shell with uninstall
Co-authored-by:
Antonio QUINTAVALLE
<
antonio.quintavalle@amadeus.com
>
Co-authored-by:
Marc Cornellà
<
marc.cornella@live.com
>
parent
66d6d088
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
install.sh
tools/install.sh
+7
-0
uninstall.sh
tools/uninstall.sh
+15
-6
No files found.
tools/install.sh
View file @
2e54ba2d
...
@@ -184,6 +184,13 @@ setup_shell() {
...
@@ -184,6 +184,13 @@ setup_shell() {
fi
fi
fi
fi
# We're going to change the default shell, so back up the current one
if
[
-n
$SHELL
]
;
then
echo
$SHELL
>
~/.shell.pre-oh-my-zsh
else
grep
"^
$USER
:"
/etc/passwd |
awk
-F
:
'{print $7}'
>
~/.shell.pre-oh-my-zsh
fi
# Actually change the default shell to zsh
# Actually change the default shell to zsh
if
!
chsh
-s
"
$zsh
"
;
then
if
!
chsh
-s
"
$zsh
"
;
then
error
"chsh command unsuccessful. Change your default shell manually."
error
"chsh command unsuccessful. Change your default shell manually."
...
...
tools/uninstall.sh
View file @
2e54ba2d
...
@@ -22,14 +22,23 @@ if [ -e "$ZSHRC_ORIG" ]; then
...
@@ -22,14 +22,23 @@ if [ -e "$ZSHRC_ORIG" ]; then
mv
"
$ZSHRC_ORIG
"
~/.zshrc
mv
"
$ZSHRC_ORIG
"
~/.zshrc
echo
"Your original zsh config was restored. Please restart your session."
echo
"Your original zsh config was restored."
else
fi
if
hash
chsh
>
/dev/null 2>&1
;
then
echo
"Switching back to bash"
if
hash
chsh
>
/dev/null 2>&1
;
then
chsh
-s
/bin/bash
if
[
-f
~/.shell.pre-oh-my-zsh
]
;
then
old_shell
=
$(
cat
~/.shell.pre-oh-my-zsh
)
else
old_shell
=
/bin/bash
fi
echo
"Switching your shell back to '
$old_shell
':"
if
chsh
-s
"
$old_shell
"
;
then
rm
-f
~/.shell.pre-oh-my-zsh
else
else
echo
"You can edit /etc/passwd to switch your default shell back to bash"
echo
"Could not change default shell. Change it manually by running chsh"
echo
"or editing the /etc/passwd file."
fi
fi
fi
fi
echo
"Thanks for trying out Oh My Zsh. It's been uninstalled."
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