the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1param(
2 [string]$OutDir,
3 [string]$ProjectDir
4)
5
6Write-Host "Post-build script started. Output Directory: $OutDir, Project Directory: $ProjectDir"
7
8$directories = @(
9 "music",
10 "Windows64\GameHDD",
11 "Common\Media",
12 "Common\res",
13 "Common\Trial",
14 "Common\Tutorial",
15 "Windows64Media"
16)
17
18foreach ($dir in $directories) {
19 New-Item -ItemType Directory -Path (Join-Path $OutDir $dir) -Force | Out-Null
20}
21
22$copies = @(
23 @{ Source = "music"; Dest = "music" },
24 @{ Source = "Common\Media"; Dest = "Common\Media" },
25 @{ Source = "Common\res"; Dest = "Common\res" },
26 @{ Source = "Common\Trial"; Dest = "Common\Trial" },
27 @{ Source = "Common\Tutorial"; Dest = "Common\Tutorial" },
28 @{ Source = "Windows64\GameHDD"; Dest = "Windows64\GameHDD" },
29 @{ Source = "Windows64\Sound"; Dest = "Windows64\Sound" },
30 @{ Source = "DurangoMedia"; Dest = "Windows64Media" },
31 @{ Source = "Windows64Media"; Dest = "Windows64Media" }
32)
33
34foreach ($copy in $copies) {
35 $src = Join-Path $ProjectDir $copy.Source
36 $dst = Join-Path $OutDir $copy.Dest
37
38 if (Test-Path $src) {
39 # Copy the files using xcopy, forcing overwrite and suppressing errors, and only copying if the source is newer than the destination
40 xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null
41 }
42}