meta: add noisy messages to build script

This commit is contained in:
Connor Olding 2022-10-15 00:23:08 -07:00
parent 67ec821336
commit 3dfea15904

View file

@ -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/" \
@ -26,6 +33,7 @@ dbg_retrieve() { : \
build() { : \
&& local t="${1?missing argument}" && shift \
&& announce building "$t" \
&& podman build -t "$t" "$t" "$@" \
;}