From 7945c71ce231e6993789975bf18f78dd83815847 Mon Sep 17 00:00:00 2001 From: roose Date: Fri, 30 Oct 2020 19:58:23 +0600 Subject: [PATCH] chore: add full packaging after compilation --- build.ps1 | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index ed0f408..8ce2eb0 100644 --- a/build.ps1 +++ b/build.ps1 @@ -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"