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
27f4e079
Commit
27f4e079
authored
Mar 11, 2020
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updater: use hardcoded color sequences instead of tput
parent
6ba2d9de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
upgrade.sh
tools/upgrade.sh
+11
-14
No files found.
tools/upgrade.sh
View file @
27f4e079
# Use colors, but only if connected to a terminal, and that terminal
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
# supports them.
if
which tput
>
/dev/null 2>&1
;
then
if
[
-t
1
]
;
then
ncolors
=
$(
tput colors
)
RED
=
$(
printf
'\033[31m'
)
fi
GREEN
=
$(
printf
'\033[32m'
)
if
[
-t
1
]
&&
[
-n
"
$ncolors
"
]
&&
[
"
$ncolors
"
-ge
8
]
;
then
YELLOW
=
$(
printf
'\033[33m'
)
RED
=
"
$(
tput setaf 1
)
"
BLUE
=
$(
printf
'\033[34m'
)
GREEN
=
"
$(
tput setaf 2
)
"
BOLD
=
$(
printf
'\033[1m'
)
YELLOW
=
"
$(
tput setaf 3
)
"
RESET
=
$(
printf
'\033[m'
)
BLUE
=
"
$(
tput setaf 4
)
"
BOLD
=
"
$(
tput bold
)
"
NORMAL
=
"
$(
tput sgr0
)
"
else
else
RED
=
""
RED
=
""
GREEN
=
""
GREEN
=
""
YELLOW
=
""
YELLOW
=
""
BLUE
=
""
BLUE
=
""
BOLD
=
""
BOLD
=
""
NORMAL
=
""
RESET
=
""
fi
fi
cd
"
$ZSH
"
cd
"
$ZSH
"
...
@@ -51,10 +48,10 @@ then
...
@@ -51,10 +48,10 @@ then
printf
'%s\n'
'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
printf
'%s\n'
'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
printf
'%s\n'
' /____/ '
printf
'%s\n'
' /____/ '
printf
"
${
BLUE
}
%s
\n
"
"Hooray! Oh My Zsh has been updated and/or is at the current version."
printf
"
${
BLUE
}
%s
\n
"
"Hooray! Oh My Zsh has been updated and/or is at the current version."
printf
"
${
BLUE
}${
BOLD
}
%s
${
NORMAL
}
\n
"
"To keep up on the latest news and updates, follow us on twitter: https://twitter.com/ohmyzsh"
printf
"
${
BLUE
}${
BOLD
}
%s
${
RESET
}
\n
"
"To keep up on the latest news and updates, follow us on twitter: https://twitter.com/ohmyzsh"
printf
"
${
BLUE
}${
BOLD
}
%s
${
NORMAL
}
\n
"
"Get your Oh My Zsh swag at: https://shop.planetargon.com/collections/oh-my-zsh"
printf
"
${
BLUE
}${
BOLD
}
%s
${
RESET
}
\n
"
"Get your Oh My Zsh swag at: https://shop.planetargon.com/collections/oh-my-zsh"
else
else
printf
"
${
RED
}
%s
${
NORMAL
}
\n
"
'There was an error updating. Try again later?'
printf
"
${
RED
}
%s
${
RESET
}
\n
"
'There was an error updating. Try again later?'
fi
fi
# Unset git-config values set just for the upgrade
# Unset git-config values set just for the upgrade
...
...
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