Do not bundle CLIs in MCPB packages.

Point extensions at ArtCraft Launcher installs and require WordCraft/GridCraft on the machine.
This commit is contained in:
Dominic Gundel committed 2026-10-19 16:15:08 +02:00
1 parent 2fd4164ee7
commit 2c02038e8c
20 files changed
+96 -69

No files matched your search

+18 -17
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env bash
# Copies the ArtCraft-Launcher CLI into skills/<name>/extension/server/
# and writes upstream.json plus LICENSES from the matching upstream tag.
# No GitHub binary download. Requires WordCraft/GridCraft via ArtCraft Launcher.
# Checks that the ArtCraft-Launcher CLI is installed and refreshes upstream.json + LICENSES.
# Does NOT copy or ship the EXE into the extension package.
# Usage: scripts/fetch-cli.sh <skill-name> [cli-path]
set -euo pipefail
source "$(dirname "$0")/lib.sh"
@@ -22,15 +21,13 @@ fi
case "$name" in
wordcraft-mcp)
exe_name=wordcraft-cli.exe
default='/mnt/c/Program Files/WordCraft/wordcraft-cli.exe'
[[ -f "$default" ]] || default='C:/Program Files/WordCraft/wordcraft-cli.exe'
default='C:/Program Files/WordCraft/wordcraft-cli.exe'
repo='https://github.com/storytold/wordcraft'
repo_slug='storytold/wordcraft'
;;
gridcraft-mcp)
exe_name=gridcraft-cli.exe
default='/mnt/c/Program Files/GridCraft/gridcraft-cli.exe'
[[ -f "$default" ]] || default='C:/Program Files/GridCraft/gridcraft-cli.exe'
default='C:/Program Files/GridCraft/gridcraft-cli.exe'
repo='https://github.com/storytold/gridcraft'
repo_slug='storytold/gridcraft'
;;
@@ -48,13 +45,17 @@ if [[ ! -f "$src" ]]; then
fi
mkdir -p "$ext/server"
dest="$ext/server/$exe_name"
cp -f "$src" "$dest"
chmod +x "$dest" 2>/dev/null || true
rm -f "$ext/server"/*.exe
if [[ ! -f "$ext/server/README.txt" ]]; then
printf '%s\n' \
'Diese Erweiterung enthaelt keine CLI.' \
'Installiere die App ueber den ArtCraft-Launcher.' \
"Erwarteter Pfad: $src" > "$ext/server/README.txt"
fi
ver_out="$("$dest" --version 2>&1 || true)"
ver_out="$("$src" --version 2>&1 || true)"
if [[ ! "$ver_out" =~ [0-9]+\.[0-9]+\.[0-9]+ ]] && [[ "$name" == gridcraft-mcp ]]; then
ver_out="$("$dest" version 2>&1 || true)"
ver_out="$("$src" version 2>&1 || true)"
fi
if [[ ! "$ver_out" =~ ([0-9]+\.[0-9]+\.[0-9]+) ]]; then
echo "Version der CLI nicht lesbar: $ver_out" >&2
@@ -63,11 +64,11 @@ fi
ver="${BASH_REMATCH[1]}"
if command -v sha256sum >/dev/null 2>&1; then
hash="$(sha256sum "$dest" | awk '{print $1}')"
hash="$(sha256sum "$src" | awk '{print $1}')"
elif command -v shasum >/dev/null 2>&1; then
hash="$(shasum -a 256 "$dest" | awk '{print $1}')"
hash="$(shasum -a 256 "$src" | awk '{print $1}')"
else
hash="$(python3 -c "import hashlib,sys; print(hashlib.sha256(open(sys.argv[1],'rb').read()).hexdigest())" "$dest")"
hash="$(python3 -c "import hashlib,sys; print(hashlib.sha256(open(sys.argv[1],'rb').read()).hexdigest())" "$src")"
fi
python3 -c "
@@ -80,6 +81,7 @@ print(json.dumps({
'sha256': sys.argv[4],
'repository': sys.argv[5],
'tag': 'v' + sys.argv[3],
'bundled': False,
}, separators=(',', ':')))
" "$src" "$exe_name" "$ver" "$hash" "$repo" > "$ext/upstream.json"
printf '\n' >> "$ext/upstream.json" || true
@@ -94,5 +96,4 @@ for f in LICENSE-MIT LICENSE-APACHE NOTICE; do
fi
done
echo "OK $name $ver $hash"
echo " $dest"
echo "OK $name $ver (nicht gebundelt) $src"