From 8da9cbd0fc7e48e5ef66c08531ee1432757a3eea Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Fri, 14 Oct 2022 20:44:36 -0700 Subject: [PATCH] announce everything --- build-all | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build-all b/build-all index a79a6cc..b282597 100755 --- a/build-all +++ b/build-all @@ -1,10 +1,17 @@ #!/usr/bin/env sh +announce() { : \ + && printf >&2 ' \033[1m\033[7m <-- \033[0m\033[1m ' \ + && printf >&2 ' %30s %-30s ' "$1" "$2" \ + && printf >&2 ' \033[1m\033[7m --> \033[0m\n' \ + ;} + yes_retrieve() { : \ && local ok=1 out= g= image="${1?missing argument}" && shift \ && [ -d out ] && out="$(realpath out)" \ && for f in "$@" \ - ;do g="out/${f##*/}" && { ! [ -e "$g" ] || mv "$g" "$g~" ;} || return \ + ;do announce retrieving "$f" \ + && g="out/${f##*/}" && { ! [ -e "$g" ] || mv "$g" "$g~" ;} || return \ ;done \ && podman run -v="$out":/out --rm --entrypoint /bin/busybox "$image" \ cp -- "$@" "/out/" \ @@ -24,12 +31,6 @@ dbg_retrieve() { : \ && yes_retrieve "$container" "$@" \ ;} -announce() { : \ - && printf >&2 ' \033[1m\033[7m <-- \033[0m\033[1m ' \ - && printf >&2 ' %30s %-30s ' "$1" "$2" \ - && printf >&2 ' \033[1m\033[7m --> \033[0m\n' \ - ;} - build() { : \ && local t="${1?missing argument}" && shift \ && announce building "$t" \