Skip to content

Commit

Permalink
chore: add full packaging after compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
roose committed Oct 30, 2020
1 parent 4308c44 commit 7945c71
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
nim c -d:release --opt:size --passL:-s npms.nim
upx npms.exe

# get version from plugin.json
$version = (Get-Content plugin.json | ConvertFrom-Json).version

# delete npms-search.zip, npms-search.$version.wox
Remove-Item "npms-search.zip", "npms-search.$version.wox" -ErrorAction 0

$images = Join-Path $PSScriptRoot "Images"
$exe = Join-Path $PSScriptRoot "npms.exe"
$json = Join-Path $PSScriptRoot "plugin.json"

$compress = @{
Path = $images, $exe, $json
CompressionLevel = "Optimal"
DestinationPath = $PSScriptRoot + "\npms-search.zip"
}
# compress files
Compress-Archive @compress

#rename .zip to .wox and add version
Rename-Item "npms-search.zip" "npms-search.$version.wox"

0 comments on commit 7945c71

Please sign in to comment.