@@ -18,21 +18,21 @@ Param(
1818 [String ] $custom = " " ,
1919
2020 [Parameter (Mandatory = $false )]
21- [Switch ] $file ,
21+ [String ] $file = " " ,
2222
2323 [Parameter (Mandatory = $false )]
2424 [Switch ] $help
2525)
2626
2727if ($help -eq $true ) {
28- echo " `" Copy`" - Builds and copies your mod to your quest, and also starts Beat Saber with optional logging"
29- echo " `n -- Arguments --`n "
28+ Write-Output " `" Copy`" - Builds and copies your mod to your quest, and also starts Beat Saber with optional logging"
29+ Write-Output " `n -- Arguments --`n "
3030
31- echo " -Clean `t`t Performs a clean build (equvilant to running `" Build -clean`" )"
32- echo " -UseDebug `t Copied the debug version of the mod to your quest"
33- echo " -Log `t`t Logs Beat Saber using the `" Start-Logging`" command"
31+ Write-Output " -Clean `t`t Performs a clean build (equvilant to running `" build -clean`" )"
32+ Write-Output " -UseDebug `t Copies the debug version of the mod to your quest"
33+ Write-Output " -Log `t`t Logs Beat Saber using the `" Start-Logging`" command"
3434
35- echo " `n -- Logging Arguments --`n "
35+ Write-Output " `n -- Logging Arguments --`n "
3636
3737 & $PSScriptRoot / start-logging.ps1 - help - excludeHeader
3838
@@ -42,18 +42,29 @@ if ($help -eq $true) {
4242& $PSScriptRoot / build.ps1 - clean:$clean
4343
4444if ($LASTEXITCODE -ne 0 ) {
45- echo " Failed to build, exiting..."
45+ Write-Output " Failed to build, exiting..."
4646 exit $LASTEXITCODE
4747}
4848
49- if ($useDebug -eq $true ) {
50- $fileName = Get-ChildItem lib* .so - Path " build/debug" - Name
51- } else {
52- $fileName = Get-ChildItem lib* .so - Path " build/" - Name
53- }
49+ # & $PSScriptRoot/validate-modjson.ps1
50+ # if ($LASTEXITCODE -ne 0) {
51+ # exit $LASTEXITCODE
52+ # }
53+ $modJson = Get-Content " ./mod.json" - Raw | ConvertFrom-Json
54+
55+ $modFiles = $modJson.modFiles
5456
55- & adb push build/ $fileName / sdcard/ Android/ data / com.beatgames.beatsaber/ files/ mods/ $fileName
57+ foreach ($fileName in $modFiles ) {
58+ if ($useDebug -eq $true ) {
59+ & adb push build/ debug/ $fileName / sdcard/ Android/ data / com.beatgames.beatsaber/ files/ mods/ $fileName
60+ } else {
61+ & adb push build/ $fileName / sdcard/ Android/ data / com.beatgames.beatsaber/ files/ mods/ $fileName
62+ }
63+ }
5664
5765& $PSScriptRoot / restart-game.ps1
5866
59- if ($log -eq $true ) { & $PSScriptRoot / start-logging.ps1 - self:$self - all:$all - custom:$custom - file:$file }
67+ if ($log -eq $true ) {
68+ & adb logcat - c
69+ & $PSScriptRoot / start-logging.ps1 - self:$self - all:$all - custom:$custom - file:$file
70+ }
0 commit comments