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

+17 -10
View File
@@ -1,6 +1,5 @@
# 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 installed 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.ps1 -Name <skill-name> [-CliPath <path>]
param(
[Parameter(Mandatory = $true)][string]$Name,
@@ -42,14 +41,22 @@ if (-not (Test-Path -LiteralPath $src)) {
exit 1
}
# Ensure no EXE is left in the extension package from older builds.
$serverDir = Join-Path $ext 'server'
New-Item -ItemType Directory -Force -Path $serverDir | Out-Null
$dest = Join-Path $serverDir $meta.ExeName
Copy-Item -LiteralPath $src -Destination $dest -Force
Get-ChildItem -LiteralPath $serverDir -Filter '*.exe' -ErrorAction SilentlyContinue | Remove-Item -Force
$readme = Join-Path $serverDir 'README.txt'
if (-not (Test-Path $readme)) {
Write-Text $readme @"
Diese Erweiterung enthaelt keine CLI.
Installiere die App ueber den ArtCraft-Launcher.
Erwarteter Pfad: $src
"@
}
$verOut = & $dest --version 2>&1 | Out-String
$verOut = & $src --version 2>&1 | Out-String
if ($LASTEXITCODE -ne 0 -and $Name -eq 'gridcraft-mcp') {
$verOut = & $dest version 2>&1 | Out-String
$verOut = & $src version 2>&1 | Out-String
}
$ver = ''
if ($verOut -match '(\d+\.\d+\.\d+)') { $ver = $Matches[1] }
@@ -58,7 +65,7 @@ if (-not $ver) {
exit 1
}
$hash = (Get-FileHash -LiteralPath $dest -Algorithm SHA256).Hash.ToLowerInvariant()
$hash = (Get-FileHash -LiteralPath $src -Algorithm SHA256).Hash.ToLowerInvariant()
$upstream = @{
source = 'ArtCraft-Launcher'
path = $src
@@ -67,6 +74,7 @@ $upstream = @{
sha256 = $hash
repository = $meta.Repo
tag = "v$ver"
bundled = $false
} | ConvertTo-Json -Compress
Write-Text (Join-Path $ext 'upstream.json') ($upstream + "`n")
@@ -86,5 +94,4 @@ foreach ($f in @('LICENSE-MIT', 'LICENSE-APACHE', 'NOTICE')) {
}
}
Write-Host "OK $Name $ver $hash"
Write-Host " $dest"
Write-Host "OK $Name $ver (nicht gebundelt) $src"