diff --git a/build.sh b/build.sh index 68793c9..a7f218e 100755 --- a/build.sh +++ b/build.sh @@ -42,10 +42,14 @@ fi if ((REMOVE || PRUNE)); then if ((REMOVE)); then - podman image rm "${IMAGE}" 2>/dev/null + if podman image exists "$IMAGE"; then + podman image rm "${IMAGE}" || echo "WARNING: could not remove $IMAGE" >&2 + else + echo "$IMAGE does not exist, nothing to remove" + fi fi if ((PRUNE)); then - podman image prune -f 2>/dev/null + podman image prune -f || echo "WARNING: prune failed" >&2 fi exit 0 fi