Skip to content

Commit

Permalink
Prohibit building a dirty worktree
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Sabaini <[email protected]>
  • Loading branch information
sabaini committed Mar 12, 2024
1 parent 1396b7b commit c540c2a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ parts:
go get -d -v ./...
override-build: |
set -ex
git_diff="$( git -C $CRAFT_PROJECT_DIR status --porcelain )"
if [ -n "$git_diff" ]; then
echo "=================================================="
echo "STOP the build: dirty worktree detected"
echo "$git_diff"
echo "=================================================="
exit 1
fi
# Setup build environment
export CGO_CFLAGS="-I${CRAFT_STAGE}/include/ -I${CRAFT_STAGE}/usr/local/include/"
export CGO_LDFLAGS="-L${CRAFT_STAGE}/lib/ -L${CRAFT_STAGE}/usr/local/lib/"
Expand Down

0 comments on commit c540c2a

Please sign in to comment.