Skip to content

Commit

Permalink
Flip plugin files condition
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gboutry committed Feb 20, 2024
1 parent a13bfe8 commit fded2ec
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions rocks/horizon/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fded2ec

Please sign in to comment.