Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions scripts/generate-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
GIT_DESCRIBE=$(git describe --tags --always --dirty 2>/dev/null || echo "unknown")
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")

# If the build runs in a dirty git checkout, `git describe --dirty` includes "-dirty".
# This extra output helps debug CI/release builds that end up stamped as dirty.
if git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git rev-parse --verify HEAD >/dev/null 2>&1; then
if ! git diff-index --quiet HEAD -- 2>/dev/null; then
echo "⚠️ Git checkout is dirty; version will be stamped with '-dirty'."
echo "Tracked dirty files:"
git diff-index --name-only HEAD -- | sed 's/^/ - /'
fi
fi

cat >src/version.ts <<EOF
// This file is auto-generated by scripts/generate-version.sh
// Do not edit manually
Expand Down