initial commit [141.14.129.234,mike]

This commit is contained in:
2026-07-26 06:38:01 +02:00
commit 5562055695
20 changed files with 2898 additions and 0 deletions
Executable
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
# Build mgsh, auto-incrementing the patch version by 0.0.1 on every build.
#
# version.txt holds the currently built version. Each run increments the patch
# component, then builds with that version injected via -ldflags, and writes it
# back. So version.txt always reflects the version of the binary just built.
set -e
cd "$(dirname "$0")"
V=$(cat version.txt 2>/dev/null || echo 4.0.0)
# split MAJOR.MINOR.PATCH and increment PATCH (no carry: 4.0.9 -> 4.0.10)
MAJOR=${V%%.*}
REST=${V#*.}
MINOR=${REST%%.*}
PATCH=${REST#*.}
PATCH=$((PATCH + 1))
NV="$MAJOR.$MINOR.$PATCH"
go build -ldflags "-X main.VERSION=$NV" -o mgsh .
echo "$NV" > version.txt
echo "built mgsh v$NV"