Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib/common.sh
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2022-10-22 15:40:40 +0200
committerLevente Polyak <anthraxx@archlinux.org>2023-05-19 22:27:12 +0200
commitd2245b1943fd30ab0252e47d47871ac94e143339 (patch)
tree9b1099c3e46dacde7a07580d8191019a2c66817e /src/lib/common.sh
parentf63d343e40f7f07c7a900cbb7445bbefa0997259 (diff)
gitlab: implemented module for required API calls
We need to use API calls as we can't create repositories in protected namespaces by simply pushing a none existing repository. For privacy reasons this is limited to private personal repositories in GitLab.
Diffstat (limited to 'src/lib/common.sh')
-rw-r--r--src/lib/common.sh24
1 files changed, 24 insertions, 0 deletions
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")