From 109d34cd1f66fbbaad493b99a2ca4285926c468f Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Sun, 29 Jan 2023 22:24:05 +0100 Subject: [PATCH] fix: [compose-core] fail on empty compose file --- bin/compose-core | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/compose-core b/bin/compose-core index 6c36281..783edf6 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -5616,6 +5616,12 @@ fi >&2 COMPOSE_YML_FILE=$(get_compose_yml_location) || exit 1 COMPOSE_YML_CONTENT=$(get_compose_yml_content) || exit 1 + +if [ -z "$COMPOSE_YML_CONTENT" ]; then + err "Compose file '$HOST_COMPOSE_YML_FILE' is empty." + exit 1 +fi + COMPOSE_YML_CONTENT_HASH=$(compose:yml:hash) || exit 1 CHARM_STORE_HASH=$(charm.store_metadata_hash) || exit 1 COMBINED_HASH=$(H "$COMPOSE_YML_CONTENT_HASH" "$CHARM_STORE_HASH") || exit 1