Skip to content

Commit

Permalink
Drop error scenario, clean up error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlewis committed Aug 8, 2024
1 parent 57d0c54 commit 6c45867
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
13 changes: 3 additions & 10 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ print_usage(){
Examples:
${BASE_NAME} 24
${BASE_NAME} 24 arm64 amd64
EOF
}

Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion bin/stack-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function display() {
}

function abort() {
echo "$1"
printf '\e[1;31m%s\n\e[0m' "$1"
exit 1
}

Expand Down

0 comments on commit 6c45867

Please sign in to comment.