forked from risk-of-thunder/BepInEx.GUI
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrelease.ps1
28 lines (21 loc) · 1.42 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
if ($PSScriptRoot -match '.+?\\bin\\?') {
$dir = $PSScriptRoot + "\"
}
else {
$dir = $PSScriptRoot + "\bin\"
}
$BIEdir = $dir + "BepInEx\"
$ver = (Get-ChildItem -Path ($BIEdir) -Filter ("*.dll") -Recurse -Force)[0].VersionInfo.FileVersion.ToString() -replace "([\d+\.]+?\d+)[\.0]*$", '${1}'
$copy = $dir + "copy\"
# Compress-Archive -Path ($BIEdir) -Force -CompressionLevel "Optimal" -DestinationPath ($dir + "BepInEx.SplashScreen_" + $ver + ".zip")
Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path ($copy)
Copy-Item -Path ($BIEdir) -Destination ($copy) -Recurse -Force
Remove-Item -Path ($copy + "\BepInEx\patchers\BepInEx.SplashScreen\BepInEx.SplashScreen.Patcher.BepInEx6.dll") -Force
Compress-Archive -Path ($copy + "BepInEx") -Force -CompressionLevel "Optimal" -DestinationPath ($dir + "BepInEx.SplashScreen_BepInEx5_v" + $ver + ".zip")
Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path ($copy)
Copy-Item -Path ($BIEdir) -Destination ($copy) -Recurse -Force
Remove-Item -Path ($copy + "\BepInEx\patchers\BepInEx.SplashScreen\BepInEx.SplashScreen.Patcher.BepInEx5.dll") -Force
Compress-Archive -Path ($copy + "BepInEx") -Force -CompressionLevel "Optimal" -DestinationPath ($dir + "BepInEx.SplashScreen_BepInEx6_v" + $ver + ".zip")
Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue