-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrelease.ps1
39 lines (30 loc) · 1.02 KB
/
release.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
if ($PSScriptRoot -match '.+?\\bin\\?') {
$dir = $PSScriptRoot + "\"
}
else {
$dir = $PSScriptRoot + "\bin\"
}
$array = @("KK_", "AI_", "HS2_", "EC_", "KKS_")
$copy = $dir + "\copy\BepInEx"
New-Item -ItemType Directory -Force -Path ($dir + "\out")
function CreateZip ($element)
{
Remove-Item -Force -Path ($dir + "\copy") -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path ($copy + "\plugins")
Copy-Item -Path ($dir + "\BepInEx\plugins\" + $element + "*.*") -Destination ($copy + "\plugins\" ) -Recurse -Force
$ver = "v" + (Get-ChildItem -Path ($copy) -Filter "*.dll" -Recurse -Force)[0].VersionInfo.FileVersion.ToString()
Compress-Archive -Path $copy -Force -CompressionLevel "Optimal" -DestinationPath ($dir + "out\" + $element + "BrowserFolders_" + $ver + ".zip")
}
foreach ($element in $array)
{
try
{
CreateZip ($element)
}
catch
{
# retry
CreateZip ($element)
}
}
Remove-Item -Force -Path ($dir + "\copy") -Recurse