summaryrefslogtreecommitdiff
path: root/utils/lib.sh
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2021-07-03 16:40:19 +0000
committerGitHub <noreply@github.com>2021-07-03 16:40:19 +0000
commitb558c5aa366b909cc99923939f4a5cab94f3e832 (patch)
treed4064839969098db3b2988dc2b4e153199bbd668 /utils/lib.sh
parent7e8d1f993588624473620b2b6c61e083e3d73512 (diff)
parent129ed4c9fa712fd3445442ac5355a847682da333 (diff)
Merge pull request #194 from return42/fix-misc
[fix] some minor issues in Makefile and shell scripts
Diffstat (limited to 'utils/lib.sh')
-rwxr-xr-xutils/lib.sh17
1 files changed, 13 insertions, 4 deletions
diff --git a/utils/lib.sh b/utils/lib.sh
index b75e3376b..014d4a740 100755
--- a/utils/lib.sh
+++ b/utils/lib.sh
@@ -78,9 +78,18 @@ required_commands() {
# shellcheck disable=SC2034
set_terminal_colors() {
- _colors=8
+ # https://en.wikipedia.org/wiki/ANSI_escape_code
+
+ # CSI (Control Sequence Introducer) sequences
+ _show_cursor='\e[?25h'
+ _hide_cursor='\e[?25l'
+
+ # SGR (Select Graphic Rendition) parameters
_creset='\e[0m' # reset all attributes
+ # original specification only had 8 colors
+ _colors=8
+
_Black='\e[0;30m'
_White='\e[1;37m'
_Red='\e[0;31m'
@@ -271,7 +280,7 @@ prefix_stdout () {
echo -e "${prefix}$line"
done)
# some piped commands hide the cursor, show cursory when the stream ends
- echo -en "\e[?25h"
+ echo -en "$_show_cursor"
}
append_line() {
@@ -1548,7 +1557,7 @@ pkg_install() {
;;
arch)
# shellcheck disable=SC2068
- pacman -Sy --noconfirm $@
+ pacman --noprogressbar -Sy --noconfirm $@
;;
fedora)
# shellcheck disable=SC2068
@@ -1580,7 +1589,7 @@ pkg_remove() {
;;
arch)
# shellcheck disable=SC2068
- pacman -R --noconfirm $@
+ pacman --noprogressbar -R --noconfirm $@
;;
fedora)
# shellcheck disable=SC2068