From 67ec821336a6bf0150916f0b95c48316bd7b13de Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sat, 15 Oct 2022 00:21:22 -0700 Subject: [PATCH] meta: reduce repetition in build script --- build-all | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/build-all b/build-all index 4c80333..59f05ea 100755 --- a/build-all +++ b/build-all @@ -24,16 +24,21 @@ dbg_retrieve() { : \ && yes_retrieve "$container" "$@" \ ;} +build() { : \ + && local t="${1?missing argument}" && shift \ + && podman build -t "$t" "$t" "$@" \ + ;} + : \ && me="$(readlink -f "$0")" && cd "${me%/*}" && { [ -d out ] || mkdir out ;} \ \ - && podman build -t notwa-util notwa-util \ - && podman build -t cosmo-bootstrap cosmo-bootstrap \ - && podman build -t cosmo-base cosmo-base \ - && podman build -t cosmo-kuroko cosmo-kuroko \ - && podman build -t cosmo-muon cosmo-muon \ - && podman build -t cosmo-perl cosmo-perl \ - && podman build -t cosmo-yices cosmo-yices \ + && build notwa-util \ + && build cosmo-bootstrap \ + && build cosmo-base \ + && build cosmo-kuroko \ + && build cosmo-muon \ + && build cosmo-perl \ + && build cosmo-yices \ \ && bin=/cosmopolitan/bin \ && yes_retrieve cosmo-base $bin/ape $bin/awk.com $bin/gzip.com $bin/make.com \