From 170de52e6bc30b89e1231f0510c823d7c4dd254d Mon Sep 17 00:00:00 2001 From: sstent Date: Tue, 17 Feb 2026 14:40:35 -0800 Subject: [PATCH] Chore: Add version consistency check to build process --- Makefile | 15 +++++++++------ check_versions.sh | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) create mode 100755 check_versions.sh diff --git a/Makefile b/Makefile index 143ec83..05807f9 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,12 @@ -# Build the plug using local deno -build: - deno task build +# Check version consistency +check-versions: + ./check_versions.sh + +# Build the plug using a Docker container with Deno +build: check-versions + docker run --rm -v /home/sstent/Projects/silverbullet-icalendar:/app -w /app denoland/deno:latest task build # Helper to build and copy to a local test space (if needed) -deploy-test: - deno task build +deploy-test: build mkdir -p test_space/_plug - cp icalendar.plug.js test_space/_plug/ \ No newline at end of file + cp icalendar.plug.js test_space/_plug/ diff --git a/check_versions.sh b/check_versions.sh new file mode 100755 index 0000000..8c89924 --- /dev/null +++ b/check_versions.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Extract versions +TS_VERSION=$(grep "const VERSION =" icalendar.ts | cut -d'"' -f2) +YAML_VERSION=$(grep "version:" icalendar.plug.yaml | head -n 1 | awk '{print $2}') +PLUG_MD_VERSION=$(grep "version:" PLUG.md | head -n 1 | awk '{print $2}') + +echo "Checking versions..." +echo "icalendar.ts: $TS_VERSION" +echo "icalendar.plug.yaml: $YAML_VERSION" +echo "PLUG.md: $PLUG_MD_VERSION" + +if [ "$TS_VERSION" == "$YAML_VERSION" ] && [ "$YAML_VERSION" == "$PLUG_MD_VERSION" ]; then + echo "✅ All versions match." + exit 0 +else + echo "❌ Version mismatch detected!" + exit 1 +fi