From 142167c7fca66389f94902d0ae0c9b3a28df2709 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Thu, 27 Oct 2022 14:57:30 +0200 Subject: [PATCH] fix: dev: ``exit`` and ``return`` corrections !minor Signed-off-by: Valentin Lab --- bin/compose-core | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/compose-core b/bin/compose-core index 4ad4ba2..8cfd251 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -3057,7 +3057,7 @@ _get_master_service_for_service_cached () { fi ## Action provided by relation ? - container_relation=$(_get_container_relation "$metadata") || exit 1 + container_relation=$(_get_container_relation "$metadata") || return 1 read-0 target_service _ _ < <(get_service_relation "$service" "$container_relation") if [ -z "$target_service" ]; then err "Couldn't find ${WHITE}relations.${container_relation}${NORMAL} in" \ @@ -3298,7 +3298,7 @@ switch_to_relation_service() { ## XXXvlab: can't get real config here if ! read-0 ts _ _ < <(get_service_relation "$SERVICE_NAME" "$relation"); then err "Couldn't find relation ${DARKCYAN}$relation${NORMAL}." - exit 1 + return 1 fi export SERVICE_NAME="$ts" @@ -3306,8 +3306,8 @@ switch_to_relation_service() { DOCKER_BASE_IMAGE=$(service_base_docker_image "$SERVICE_NAME") export DOCKER_BASE_IMAGE - target_charm=$(get_service_charm "$ts") || exit 1 - target_charm_path=$(charm.get_dir "$target_charm") || exit 1 + target_charm=$(get_service_charm "$ts") || return 1 + target_charm_path=$(charm.get_dir "$target_charm") || return 1 cd "$target_charm_path" @@ -3531,7 +3531,7 @@ get_compose_yml_content() { fi if [ -z "$COMPOSE_YML_FILE" ]; then - COMPOSE_YML_FILE=$(get_compose_yml_location) || exit 1 + COMPOSE_YML_FILE=$(get_compose_yml_location) || return 1 fi if [ -e "$COMPOSE_YML_FILE" ]; then debug "Found $WHITE$exname$NORMAL YAML file in '$COMPOSE_YML_FILE'." @@ -4322,7 +4322,7 @@ if [ -z "$is_docker_compose_action" -a "$action" ]; then esac } < <(has_service_action "$action_service" "$action") services_args=("$action_service") - get_all_relations "${services_args[@]}" >/dev/null 2>&1 || return 1 + get_all_relations "${services_args[@]}" >/dev/null 2>&1 || exit 1 ## Divert logging to stdout to stderr log () { cat >&2; }