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
1fdd5351
Commit
1fdd5351
authored
May 21, 2019
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
installer: abstract error messages
parent
576499a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
install.sh
tools/install.sh
+10
-8
No files found.
tools/install.sh
View file @
1fdd5351
...
...
@@ -17,6 +17,10 @@ command_exists() {
command
-v
"
$@
"
>
/dev/null 2>&1
}
error
()
{
echo
"Error:
$@
"
>
&2
}
# Set up color sequences
setup_color
()
{
if
command_exists tput
;
then
...
...
@@ -54,20 +58,18 @@ setup_ohmyzsh() {
echo
"
${
BLUE
}
Cloning Oh My Zsh...
${
NORMAL
}
"
command_exists git
||
{
e
cho
"Error:
git is not installed"
e
rror
"
git is not installed"
exit
1
}
if
[
"
$OSTYPE
"
=
cygwin
]
&&
git
--version
|
grep
-q
msysgit
;
then
cat
<<-
EOF
Error: Windows/MSYS Git is not supported on Cygwin
Error: Make sure the Cygwin git package is installed and is first on the
$PATH
EOF
error
"Windows/MSYS Git is not supported on Cygwin"
error
"Make sure the Cygwin git package is installed and is first on the
\$
PATH"
exit
1
fi
git clone
--depth
=
1 https://github.com/robbyrussell/oh-my-zsh.git
"
$ZSH
"
||
{
e
cho
"Error:
git clone of oh-my-zsh repo failed"
e
rror
"
git clone of oh-my-zsh repo failed"
exit
1
}
}
...
...
@@ -96,7 +98,7 @@ setup_shell() {
if
command_exists chsh
;
then
echo
"
${
BLUE
}
Time to change your default shell to zsh!
${
NORMAL
}
"
if
!
chsh
-s
$(
grep
/zsh
$
/etc/shells |
tail
-1
)
;
then
e
cho
"Error:
chsh command unsuccessful. Change your default shell manually."
e
rror
"
chsh command unsuccessful. Change your default shell manually."
fi
# Else, suggest the user do so manually.
else
...
...
@@ -119,7 +121,7 @@ main() {
if
[
-d
"
$ZSH
"
]
;
then
cat
<<-
EOF
${
YELLOW
}
You already have Oh My Zsh installed.
${
NORMAL
}
You'll need to remove
$ZSH
if you want to reinstall.
You'll need to remove
'
$ZSH
'
if you want to reinstall.
EOF
exit
1
fi
...
...
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