more flexible deploy script

This commit is contained in:
Akash Mozumdar 2019-02-02 16:54:29 -05:00
parent f74cd553c0
commit dcfbeafd44

View File

@ -1,11 +1,10 @@
param([string]$arch = "86", [string]$folder = "Textractor$($arch)")
Set-Location $PSScriptRoot; Set-Location $PSScriptRoot;
foreach ($arch in @("86", "64")) { $targets = @(
$folder = "Textractor$($arch)";
$targets = @(
"Textractor.exe", "Textractor.exe",
"TextractorCLI.exe", "TextractorCLI.exe",
"vc_redist.x$($arch).exe"
"vnrhook.dll", "vnrhook.dll",
"Qt5Core.dll", "Qt5Core.dll",
"Qt5Gui.dll", "Qt5Gui.dll",
@ -23,9 +22,8 @@ foreach ($arch in @("86", "64")) {
"Thread Linker.dll", "Thread Linker.dll",
"platforms", "platforms",
"styles" "styles"
) | ForEach-Object { "builds/RelWithDebInfo_x$($arch)/$($_)" }; ) | ForEach-Object { "builds/RelWithDebInfo_x$($arch)/$($_)" };
mkdir -Force -Verbose $folder; mkdir -Force -Verbose $folder;
Remove-Item -Force -Recurse -Verbose "$($folder)/*"; Remove-Item -Force -Recurse -Verbose "$($folder)/*";
Copy-Item -Force -Recurse -Verbose -Destination $folder -Path $targets; Copy-Item -Force -Recurse -Verbose -Destination $folder -Path $targets;
Compress-Archive -Force -Verbose -DestinationPath $folder -Path $folder; Compress-Archive -Force -Verbose -DestinationPath "$($folder).zip" -Path $folder;
}