pack.ps1 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. $ErrorActionPreference = 'Stop'
  2. $ProgressPreference = 'SilentlyContinue'
  3. $root = Split-Path -Parent $PSScriptRoot
  4. $dist = Join-Path $root 'dist'
  5. $zip = Join-Path $dist 'openclaw-wechat-skill-v1.2.2.zip'
  6. New-Item -ItemType Directory -Path $dist -Force | Out-Null
  7. if (Test-Path $zip) { Remove-Item -Force $zip }
  8. Add-Type -AssemblyName System.IO.Compression
  9. Add-Type -AssemblyName System.IO.Compression.FileSystem
  10. $items = @(
  11. 'wechat',
  12. 'workflows',
  13. '__config',
  14. 'daemon',
  15. 'deploy-to-openclaw.ps1',
  16. 'deploy-to-openclaw.js',
  17. 'deploy-to-openclaw.sh',
  18. 'check-deployment.js',
  19. 'quick-start.sh',
  20. 'README.md',
  21. 'AGENT-PROMPT.md'
  22. )
  23. $archive = [System.IO.Compression.ZipFile]::Open($zip, [System.IO.Compression.ZipArchiveMode]::Create)
  24. try {
  25. foreach ($item in $items) {
  26. $full = Join-Path $root $item
  27. if (-not (Test-Path $full)) { Write-Warning "skip missing: $item"; continue }
  28. $info = Get-Item $full
  29. if ($info.PSIsContainer) {
  30. Get-ChildItem -Path $full -Recurse -File | ForEach-Object {
  31. $rel = $_.FullName.Substring($root.Length + 1).Replace('\','/')
  32. [System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($archive, $_.FullName, $rel) | Out-Null
  33. }
  34. } else {
  35. $rel = $info.FullName.Substring($root.Length + 1).Replace('\','/')
  36. [System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($archive, $info.FullName, $rel) | Out-Null
  37. }
  38. }
  39. } finally {
  40. $archive.Dispose()
  41. }
  42. Write-Host ("OK: {0} ({1:N0} bytes)" -f $zip, (Get-Item $zip).Length)