-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathterribuild_switch.ps1
More file actions
69 lines (56 loc) · 2.55 KB
/
terribuild_switch.ps1
File metadata and controls
69 lines (56 loc) · 2.55 KB
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
60
61
62
63
64
65
66
67
68
69
param ([string]$region)
$version_string = "2.2.0"
switch ($region) {
"EU" { $title_id = "01004620180D2000"; $suffix = "eng"; break }
"US" { $title_id = "0100837017CBA000"; $suffix = "eng"; break }
Default {}
}
function PrintSection {
param ([string]$desc)
$line = "------------------------------------------------------------------------"
$len = (($line.length, $desc.legnth) | Measure -Max).Maximum
Write-Host ""
Write-Host $line.PadRight($len) -BackgroundColor DarkBlue -ForegroundColor Cyan
Write-Host (" >> " + $desc).PadRight($len) -BackgroundColor DarkBlue -ForegroundColor Cyan
Write-Host $line.PadRight($len) -BackgroundColor DarkBlue -ForegroundColor Cyan
Write-Host ""
}
Write-Output " TERRIBUILD"
Write-Output "Rated World's #1 Build Script By Leading Game Industry Officials"
Write-Output ""
Write-Output "------------------------------------------------------------------------"
Write-Output ""
PrintSection "Creating new DIST and temp"
Remove-Item -Force -Recurse -ErrorAction SilentlyContinue .\DIST
New-Item -ItemType directory -Path .\DIST | Out-Null
PrintSection "Pulling latest script changes"
cd coalesc3
& git pull
cd data/chaos_child/txt_eng
& git pull
cd ../../../..
PrintSection "Patching scripts and copying to romfs"
cd coalesc3
python build.py chaos_child switch $suffix --clean
Copy-Item -Recurse .\out\chaos_child\switch_$suffix ..\DIST\atmosphere\contents\$title_id\romfs\script
cd ..
PrintSection "Copying assets to romfs"
Copy-Item -Recurse .\c0data_switch_$suffix\* .\DIST\atmosphere\contents\$title_id\romfs
PrintSection "Building RegionalDialect and copying to exefs"
cd RegionalDialect
docker build -t regiondialect-build .
docker run --rm -v ${PWD}:/workspace regiondialect-build bash -c "cmake --preset Release . -DTITLE_ID=$title_id && cmake --build . --preset Release"
New-Item -ItemType directory -Path ..\DIST\atmosphere\contents\$title_id\exefs | Out-Null
Copy-Item .\output\Release\main.npdm ..\DIST\atmosphere\contents\$title_id\exefs\main.npdm
Copy-Item .\output\Release\subsdk9 ..\DIST\atmosphere\contents\$title_id\exefs\subsdk9
cd ..
PrintSection "Copying readme and license"
Copy-Item -Recurse .\content_switch\* .\DIST\atmosphere\contents\$title_id
PrintSection "Clean"
Get-ChildItem -Path .\DIST -Include .gitkeep -Recurse | foreach { $_.Delete()}
PrintSection "Packing the patch"
$patchFolderName = "CCSwitch${region}Patch-v$version_string-Setup"
cd .\DIST
7z a -mx=5 "$patchFolderName.zip" "."
Remove-Item -Force -Recurse .\atmosphere
cd ..