Skip to content

Commit

Permalink
Fix for PowerShell 5 and colorized output
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Mar 29, 2019
1 parent 44de26e commit 150d4e5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions MakeZipWindows.ps1 100644 → 100755
@@ -1,5 +1,7 @@
#!powershell
#
#!/usr/bin/env pwsh

Set-StrictMode -Version 5.0

$include_files = @( 'addon.py', 'addon.xml', 'LICENSE', 'README.md', 'service.py' )
$include_paths = @( 'resources/' )
$exclude_files = @( '*.new', '*.orig', '*.pyc' )
Expand All @@ -17,9 +19,9 @@ if (Test-Path -LiteralPath $zip_name) {
}

# Create ZIP file
Add-Type -AssemblyName System.IO.Compression
Add-Type -AssemblyName System.IO.Compression.FileSystem

Write-Host '= Building new package'
Write-Host -fore blue '= Building new package'
$zip_file = [System.IO.Compression.ZipFile]::Open($zip_name, 'Create')
ForEach ($relative_file in $include_files) {
$archive_file = Join-Path -Path $name -ChildPath $relative_file
Expand All @@ -33,4 +35,5 @@ ForEach ($path in $include_paths) {
}
}
$zip_file.Dispose()
Write-Host "= Successfully wrote package as: $zip_name"
Write-Host "= Successfully wrote package as: " -ForegroundColor:Blue -NoNewLine
Write-Host "$zip_name" -ForegroundColor:Cyan

0 comments on commit 150d4e5

Please sign in to comment.