Skip to content

Commit

Permalink
Add MakeZipWindows.ps1 PowerShell script
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Mar 28, 2019
1 parent 44a228c commit b67b217
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 494 deletions.
1 change: 0 additions & 1 deletion MakeZipWindows.bat

This file was deleted.

27 changes: 27 additions & 0 deletions MakeZipWindows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!powershell

[xml]$XmlDocument = Get-Content -LiteralPath 'addon.xml'
$name = $XmlDocument.addon.id
$version = $XmlDocument.addon.version
$git_hash = Invoke-Expression 'git rev-parse --short HEAD'

$zip_name = "$name-$version-$git_hash.zip"
$include_files = @( 'addon.py', 'addon.xml', 'LICENSE', 'README.md', 'service.py' )
$include_paths = @( 'resources/' )
$exclude_paths = @( 'test/' )

Add-Type -AssemblyName System.IO.Compression
Remove-Item -LiteralPath $zip_name

Write-Host '= Building new package'
$zip_file = [System.IO.Compression.ZipFile]::Open($zip_name, 'Create')
ForEach ($file in $include_files) {
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($zip_file, $file, "$name/$file")
}
ForEach ($path in $include_paths) {
Get-ChildItem -Recurse -File -LiteralPath $path | ForEach-Object {
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($zip_file, $_.FullName, "$name/$(Resolve-Path -Path $_.FullName -Relative)")
}
}
$zip_file.Dispose()
Write-Host "= Successfully wrote package as: $zip_name"
12 changes: 0 additions & 12 deletions packagemaker/Packagemaker.csproj

This file was deleted.

129 changes: 0 additions & 129 deletions packagemaker/Program.cs

This file was deleted.

15 changes: 0 additions & 15 deletions packagemaker/Properties/PublishProfiles/FolderProfile.pubxml

This file was deleted.

Loading

0 comments on commit b67b217

Please sign in to comment.