From fded2ec2c257adf36c99253273c15c8d4ea16810 Mon Sep 17 00:00:00 2001 From: Guillaume Boutry Date: Tue, 20 Feb 2024 09:56:45 +0100 Subject: [PATCH] Flip plugin files condition Rockcraft's scriptlet runner is checking final exit code. Since we were using negative tests, the final exit code was 1 (even though there were no errors). Flip the conditions so that they return 0 when there's no issue. --- rocks/horizon/rockcraft.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rocks/horizon/rockcraft.yaml b/rocks/horizon/rockcraft.yaml index ebdbea1..77b0c81 100644 --- a/rocks/horizon/rockcraft.yaml +++ b/rocks/horizon/rockcraft.yaml @@ -82,12 +82,10 @@ parts: while read line; do enable_file=$CRAFT_STAGE/$ENABLED/$line available_file=$CRAFT_PRIME/$AVAILABLE/$line - [[ -f $enable_file ]] && mv $enable_file $available_file - [[ ! -f $available_file ]] && echo "File $available_file not found" && exit 1 + [[ ! -f $enable_file ]] || mv $enable_file $available_file + [[ -f $available_file ]] || (echo "File $available_file not found" && exit 1) done < $CRAFT_STAGE/$AVAILABLE/$plugin_file done - # load bearing echo, do not remove - echo processed plugin files horizon-plugin: plugin: dump