From ddf197c0576f61a8e2a0b71051fc0f3faf3228b8 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 7 May 2024 21:21:43 +0200 Subject: [PATCH] pack.sh: refuse to run if there are uncommited assets --- src/build/pack.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/build/pack.sh b/src/build/pack.sh index 2f4469f..96fe5f7 100755 --- a/src/build/pack.sh +++ b/src/build/pack.sh @@ -15,6 +15,15 @@ set -e +function check_uncommitted_assets() { + ( cd assets; [ $(git status --porcelain . | wc -l) -gt 0 ] ) +} + +if check_uncommitted_assets; then + echo "Please make sure there are no uncommited files in the 'asset' directory before packing" + exit 1 +fi + if [ "$1" == "-b" ]; then cargo build --release --target=x86_64-unknown-linux-gnu --no-default-features --features release_linux cargo build --release --target=x86_64-pc-windows-gnu --no-default-features --features release_windows