From 6c45867c51353045fdaf3705cd2a03b6479542f7 Mon Sep 17 00:00:00 2001 From: Josh W Lewis Date: Thu, 8 Aug 2024 09:07:34 -0500 Subject: [PATCH] Drop error scenario, clean up error reporting --- bin/build.sh | 13 +++---------- bin/stack-helpers.sh | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/bin/build.sh b/bin/build.sh index 9471ea4e..1c2e1e78 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -41,6 +41,7 @@ print_usage(){ Examples: ${BASE_NAME} 24 ${BASE_NAME} 24 arm64 amd64 + EOF } @@ -71,19 +72,11 @@ else VARIANTS=("-build:") fi -if (( ${#ARCHS[@]} > 1 )) && (( STACK_VERSION <= 22 )) ; then - >&2 echo "ERROR: Can't build multi-arch images for heroku-22 and prior." \ - "Provide a single target architecture or use a newer stack version." - abort 1 -fi if (( ${#ARCHS[@]} > 1 )) && [[ ! $have_containerd_snapshotter ]] ; then - >&2 echo "ERROR: Can't build images with this configuration. Enable" \ - "the 'containerd' snapshotter in Docker Desktop, or specify a" \ - "single target architecture" - abort 1 + >&2 print_usage + abort "fatal: 'containerd' snapshotter required for multi-arch builds" fi - write_package_list() { local image_tag="$1" local dockerfile_dir="$2" diff --git a/bin/stack-helpers.sh b/bin/stack-helpers.sh index e273ddfa..5c2fb7d6 100644 --- a/bin/stack-helpers.sh +++ b/bin/stack-helpers.sh @@ -5,7 +5,7 @@ function display() { } function abort() { - echo "$1" + printf '\e[1;31m%s\n\e[0m' "$1" exit 1 }