index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
author | Levente Polyak <anthraxx@archlinux.org> | 2022-10-22 15:40:40 +0200 |
---|---|---|
committer | Levente Polyak <anthraxx@archlinux.org> | 2023-05-19 22:27:12 +0200 |
commit | d2245b1943fd30ab0252e47d47871ac94e143339 (patch) | |
tree | 9b1099c3e46dacde7a07580d8191019a2c66817e /src/lib/common.sh | |
parent | f63d343e40f7f07c7a900cbb7445bbefa0997259 (diff) |
-rw-r--r-- | src/lib/common.sh | 24 |
diff --git a/src/lib/common.sh b/src/lib/common.sh index f977726..1fe396c 100644 --- a/src/lib/common.sh +++ b/src/lib/common.sh @@ -53,6 +53,30 @@ stat_done() { printf "${BOLD}done${ALL_OFF}\n" >&2 } +msg_success() { + local msg=$1 + local padding + padding=$(echo "${msg}"|sed -E 's/( *).*/\1/') + msg=$(echo "${msg}"|sed -E 's/ *(.*)/\1/') + printf "%s %s\n" "${padding}${GREEN}✓${ALL_OFF}" "${msg}" >&2 +} + +msg_error() { + local msg=$1 + local padding + padding=$(echo "${msg}"|sed -E 's/( *).*/\1/') + msg=$(echo "${msg}"|sed -E 's/ *(.*)/\1/') + printf "%s %s\n" "${padding}${RED}x${ALL_OFF}" "${msg}" >&2 +} + +msg_warn() { + local msg=$1 + local padding + padding=$(echo "${msg}"|sed -E 's/( *).*/\1/') + msg=$(echo "${msg}"|sed -E 's/ *(.*)/\1/') + printf "%s %s\n" "${padding}${YELLOW}!${ALL_OFF}" "${msg}" >&2 +} + _setup_workdir=false setup_workdir() { [[ -z ${WORKDIR:-} ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX") |