Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
27f4e079
Commit
27f4e079
authored
Mar 11, 2020
by
Marc Cornellà
Browse files
updater: use hardcoded color sequences instead of tput
parent
6ba2d9de
Changes
1
Show whitespace changes
Inline
Side-by-side
tools/upgrade.sh
View file @
27f4e079
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if
which tput
>
/dev/null 2>&1
;
then
ncolors
=
$(
tput colors
)
fi
if
[
-t
1
]
&&
[
-n
"
$ncolors
"
]
&&
[
"
$ncolors
"
-ge
8
]
;
then
RED
=
"
$(
tput setaf 1
)
"
GREEN
=
"
$(
tput setaf 2
)
"
YELLOW
=
"
$(
tput setaf 3
)
"
BLUE
=
"
$(
tput setaf 4
)
"
BOLD
=
"
$(
tput bold
)
"
NORMAL
=
"
$(
tput sgr0
)
"
if
[
-t
1
]
;
then
RED
=
$(
printf
'\033[31m'
)
GREEN
=
$(
printf
'\033[32m'
)
YELLOW
=
$(
printf
'\033[33m'
)
BLUE
=
$(
printf
'\033[34m'
)
BOLD
=
$(
printf
'\033[1m'
)
RESET
=
$(
printf
'\033[m'
)
else
RED
=
""
GREEN
=
""
YELLOW
=
""
BLUE
=
""
BOLD
=
""
NORMAL
=
""
RESET
=
""
fi
cd
"
$ZSH
"
...
...
@@ -51,10 +48,10 @@ then
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
}${
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
${
NORMAL
}
\n
"
"Get your Oh My Zsh swag at: https://shop.planetargon.com/collections/oh-my-zsh"
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
${
RESET
}
\n
"
"Get your Oh My Zsh swag at: https://shop.planetargon.com/collections/oh-my-zsh"
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
# 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