forked from mosirnik/KK_MainGameVR
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrelease.ps1
59 lines (44 loc) · 3.29 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
if ($PSScriptRoot -match '.+?\\bin\\?') {
$dir = $PSScriptRoot + "\"
}
else {
$dir = $PSScriptRoot + "\bin\"
}
$out = $dir + "\out"
Remove-Item -Force -Path ($out) -Recurse -ErrorAction SilentlyContinue
# KK -------------------------------------
Write-Output ("# Creating KK release #")
New-Item -ItemType Directory -Force -Path ($out + "\BepInEx\plugins\KK_MainGameVR\Images") | Out-Null
New-Item -ItemType Directory -Force -Path ($out + "\BepInEx\patchers\KK_MainGameVR_Patcher") | Out-Null
New-Item -ItemType Directory -Force -Path ($out + "\Koikatu_Data") | Out-Null
Copy-Item -Path ($dir + "\KK\*") -Destination ($out + "\BepInEx\plugins\KK_MainGameVR") -ErrorAction Stop -Force | Out-Null
# Copy-Item copies empty directories and I don't see any way to tell it to only copy files
Remove-Item -Path ($out + "\BepInEx\plugins\KK_MainGameVR\Data") -Force
Remove-Item -Path ($out + "\BepInEx\plugins\KK_MainGameVR\Patcher") -Force
Remove-Item -Path ($out + "\BepInEx\plugins\KK_MainGameVR\Plugins") -Force
Copy-Item -Path ($dir + "\KK\Patcher\*") -Destination ($out + "\BepInEx\patchers\KK_MainGameVR_Patcher") | Out-Null
Copy-Item -Path ($dir + "\KK\Images\*") -Destination ($out + "\BepInEx\plugins\KK_MainGameVR\Images\") -Force | Out-Null
Copy-Item -Path ($dir + "\KK\Data\*") -Destination ($out + "\Koikatu_Data") -Recurse | Out-Null
$ver = "v" + (Get-ChildItem -Path ($dir + "\KK\KoikatuVR.dll") -Force -ErrorAction Stop)[0].VersionInfo.FileVersion.ToString() -replace "([\d+\.]+?\d+)[\.0]*$", '${1}'
Write-Output ("Version " + $ver)
Compress-Archive -Path ($out + "\*") -Force -CompressionLevel "Optimal" -DestinationPath ($dir +"KK_VR_" + $ver + ".zip")
# KK Party
Write-Output ("Also creating KK Party release")
Rename-Item ($out + "\Koikatu_Data") -NewName "Koikatsu Party_Data"
Compress-Archive -Path ($out + "\*") -Force -CompressionLevel "Optimal" -DestinationPath ($dir +"KKParty_VR_" + $ver + ".zip")
Remove-Item -Force -Path ($out) -Recurse -ErrorAction Inquire
# KKS ------------------------------------
Write-Output ("# Creating KKS release #")
New-Item -ItemType Directory -Force -Path ($out + "\BepInEx\plugins\KKS_VR\Images") | Out-Null
New-Item -ItemType Directory -Force -Path ($out + "\CharaStudio_Data") | Out-Null
New-Item -ItemType Directory -Force -Path ($out + "\KoikatsuSunshine_Data") | Out-Null
Copy-Item -Path ($dir + "\KKS\*") -Destination ($out + "\BepInEx\plugins\KKS_VR") -Force -ErrorAction Stop | Out-Null
# Copy-Item copies empty directories and I don't see any way to tell it to only copy files
Remove-Item -Path ($out + "\BepInEx\plugins\KKS_VR\Libs") -Force
Copy-Item -Path ($dir + "\KKS\Images\*") -Destination ($out + "\BepInEx\plugins\KKS_VR\Images\") -Force | Out-Null
Copy-Item -Path ($dir + "\KKS\Libs\_Data\*") -Destination ($out + "\CharaStudio_Data") -Recurse | Out-Null
Copy-Item -Path ($dir + "\KKS\Libs\_Data\*") -Destination ($out + "\KoikatsuSunshine_Data") -Recurse | Out-Null
$ver = "v" + (Get-ChildItem -Path ($dir + "\KKS\KKS_MainGameVR.dll") -Force -ErrorAction Stop)[0].VersionInfo.FileVersion.ToString() -replace "([\d+\.]+?\d+)[\.0]*$", '${1}'
Write-Output ("Version " + $ver)
Compress-Archive -Path ($out + "\*") -Force -CompressionLevel "Optimal" -DestinationPath ($dir +"KKS_VR_" + $ver + ".zip")
Remove-Item -Force -Path ($out) -Recurse -ErrorAction SilentlyContinue