Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
66d6d088
Commit
66d6d088
authored
May 28, 2019
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
installer: improve message formatting and color
parent
b931d6a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
install.sh
tools/install.sh
+13
-3
No files found.
tools/install.sh
View file @
66d6d088
...
...
@@ -101,6 +101,8 @@ setup_ohmyzsh() {
error
"git clone of oh-my-zsh repo failed"
exit
1
}
echo
}
setup_zshrc
()
{
...
...
@@ -128,13 +130,15 @@ setup_zshrc() {
mv
~/.zshrc
"
$OLD_ZSHRC
"
fi
echo
"
${
BLUE
}
Using the Oh My Zsh template file and adding it to ~/.zshrc.
${
RESET
}
"
echo
"
${
GREEN
}
Using the Oh My Zsh template file and adding it to ~/.zshrc.
${
RESET
}
"
cp
"
$ZSH
/templates/zshrc.zsh-template"
~/.zshrc
sed
"/^export ZSH=/ c
\\
export ZSH=
\"
$ZSH
\"
"
~/.zshrc
>
~/.zshrc-omztemp
mv
-f
~/.zshrc-omztemp ~/.zshrc
echo
}
setup_shell
()
{
...
...
@@ -157,7 +161,7 @@ setup_shell() {
return
fi
echo
"
${
BLUE
}
Time to change your default shell to zsh
!
${
RESET
}
"
echo
"
${
BLUE
}
Time to change your default shell to zsh
:
${
RESET
}
"
# Test for the right location of the "shells" file
if
[
-f
/etc/shells
]
;
then
...
...
@@ -174,7 +178,8 @@ setup_shell() {
# 2. If that fails, get a zsh path from the shells file, then check it actually exists
if
!
zsh
=
$(
which zsh
)
||
!
grep
-qx
"
$zsh
"
"
$shells_file
"
;
then
if
!
zsh
=
$(
grep
'^/.*/zsh$'
"
$shells_file
"
|
tail
-1
)
||
[
!
-f
"
$zsh
"
]
;
then
error
"no available zsh binary found. Change your default shell manually."
error
"no zsh binary found or not present in '
$shells_file
'"
error
"change your default shell manually."
return
fi
fi
...
...
@@ -182,7 +187,12 @@ setup_shell() {
# Actually change the default shell to zsh
if
!
chsh
-s
"
$zsh
"
;
then
error
"chsh command unsuccessful. Change your default shell manually."
else
export
SHELL
=
"
$zsh
"
echo
"
${
GREEN
}
Shell successfully changed to '
$zsh
'.
${
RESET
}
"
fi
echo
}
main
()
{
...
...
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