Initial commit: claude-skills with wordcraft-mcp and gridcraft-mcp 0.1.0.
This commit is contained in:
commit
cf01e22a1e
50 files changed
+2726
No files matched your search
@@ -0,0 +1,52 @@
|
||||
# Prueft und verpackt alle Skills (oder nur den angegebenen) als dist\<name>-v<version>.zip.
|
||||
# Im ZIP liegt der Ordner <name>/ auf oberster Ebene.
|
||||
# README.md und CHANGELOG.md werden nicht mitverpackt.
|
||||
# Pfade im ZIP immer mit "/" (Compress-Archive in Windows PowerShell 5.1 schreibt "\",
|
||||
# das bricht den Upload). Deshalb System.IO.Compression direkt.
|
||||
# Aufruf: scripts\package.ps1 [-Name <skill-name>]
|
||||
param([string]$Name)
|
||||
. (Join-Path $PSScriptRoot 'lib.ps1')
|
||||
|
||||
& (Join-Path $PSScriptRoot 'validate.ps1') -Name $Name
|
||||
if ($LASTEXITCODE -ne 0) { exit 1 }
|
||||
|
||||
Add-Type -AssemblyName System.IO.Compression
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
|
||||
if ($Name) { $names = @($Name) } else { $names = @(Get-SkillNames) }
|
||||
New-Item -ItemType Directory -Force -Path $DistDir | Out-Null
|
||||
$exclude = @('CHANGELOG.md', 'README.md', '.DS_Store', 'Thumbs.db')
|
||||
|
||||
foreach ($n in $names) {
|
||||
$src = (Get-Item (Join-Path $SkillsDir $n)).FullName
|
||||
$version = Get-SkillVersion $src
|
||||
$zipPath = Join-Path $DistDir "$n-v$version.zip"
|
||||
if (Test-Path $zipPath) { Remove-Item $zipPath }
|
||||
|
||||
$extPrefix = (Join-Path $src 'extension') + [IO.Path]::DirectorySeparatorChar
|
||||
$files = @(Get-ChildItem -Path $src -Recurse -File -Force |
|
||||
Where-Object {
|
||||
$exclude -notcontains $_.Name -and
|
||||
(-not $_.FullName.StartsWith($extPrefix, [StringComparison]::OrdinalIgnoreCase))
|
||||
} |
|
||||
ForEach-Object { $_.FullName })
|
||||
[Array]::Sort($files, [StringComparer]::Ordinal)
|
||||
|
||||
$zip = [IO.Compression.ZipFile]::Open($zipPath, [IO.Compression.ZipArchiveMode]::Create)
|
||||
try {
|
||||
[void]$zip.CreateEntry("$n/")
|
||||
foreach ($f in $files) {
|
||||
$rel = $f.Substring($src.Length).TrimStart('\', '/') -replace '\\', '/'
|
||||
[void][IO.Compression.ZipFileExtensions]::CreateEntryFromFile($zip, $f, "$n/$rel")
|
||||
}
|
||||
}
|
||||
finally { $zip.Dispose() }
|
||||
|
||||
Write-Host ''
|
||||
Write-Host "dist/$n-v$version.zip"
|
||||
$read = [IO.Compression.ZipFile]::OpenRead($zipPath)
|
||||
try {
|
||||
foreach ($e in $read.Entries) { Write-Host ('{0,9} {1}' -f $e.Length, $e.FullName) }
|
||||
}
|
||||
finally { $read.Dispose() }
|
||||
}
|
||||
Reference in new issue
Block a user