From 24d9244ad4f99bed979bedd7682acdd6c3ce80ad Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Thu, 10 Jan 2019 01:59:27 -0500 Subject: [PATCH] DRY build script --- deploy.ps1 | 58 ++++++++++++++++++++++-------------------------------- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/deploy.ps1 b/deploy.ps1 index 99288ea..36344f8 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -1,35 +1,25 @@ -cd Builds/RelWithDebInfo_x86; -Compress-Archive -Force -DestinationPath Textractor -Path @( - "Textractor.exe", - "styles", - "platforms", - "Qt5Core.dll", - "Qt5Gui.dll", - "Qt5Widgets.dll", - "vnrhook.dll", - "Bing Translate.dll", - "Copy to Clipboard.dll", - "Extra Newlines.dll", - "Google Translate.dll", - "Regex Filter.dll", - "Remove Repetition.dll", - "Extensions.txt" -) +Set-Location "$($PSScriptRoot)/Builds"; -cd ../RelWithDebInfo_x64; -Compress-Archive -Force -DestinationPath Textractor -Path @( - "Textractor.exe", - "styles", - "platforms", - "Qt5Core.dll", - "Qt5Gui.dll", - "Qt5Widgets.dll", - "vnrhook.dll", - "Bing Translate.dll", - "Copy to Clipboard.dll", - "Extra Newlines.dll", - "Google Translate.dll", - "Regex Filter.dll", - "Remove Repetition.dll", - "Extensions.txt" -) +foreach ($arch in @("86", "64")) { + $folder = "Textractor$($arch)"; + $targets = @( + "Textractor.exe", + "Qt5Core.dll", + "Qt5Gui.dll", + "Qt5Widgets.dll", + "vnrhook.dll", + "Bing Translate.dll", + "Copy to Clipboard.dll", + "Extra Newlines.dll", + "Google Translate.dll", + "Regex Filter.dll", + "Remove Repetition.dll", + "Extensions.txt", + "platforms", + "styles" + ) | ForEach-Object { "RelWithDebInfo_x$($arch)/$($_)" }; + mkdir -Force -Verbose $folder; + Remove-Item -Force -Recurse -Verbose "$($folder)/*"; + Copy-Item -Force -Recurse -Verbose -Destination $folder -Path $targets; + Compress-Archive -Force -Verbose -DestinationPath $folder -Path $folder; +}