Skip to content

Commit e4dc87b

Browse files
committed
Try a switch statement
1 parent 8c4b58a commit e4dc87b

File tree

1 file changed

+34
-16
lines changed

1 file changed

+34
-16
lines changed

Diff for: prepare.ps1

+34-16
Original file line numberDiff line numberDiff line change
@@ -1213,22 +1213,40 @@ function Setup-DesktopShortcuts {
12131213
}
12141214

12151215

1216-
1217-
# Main script
1218-
Get-ScriptPath -ScriptPath $MyInvocation.MyCommand.Path
1219-
Install-Chocolatey
1220-
InstallScoop
1221-
ConfigureScoop
1222-
Install-AdditionalSoftware
1223-
AcquireFiles
1224-
Install-EmulationStation
1225-
Setup-EmulatorCores
1226-
Start-RetroarchAndGenerateConfig
1227-
Setup-Roms
1228-
Setup-EmulationStationConfig
1229-
Setup-DolphinConfig
1230-
Setup-Scraper
1231-
Setup-DesktopShortcuts
1216+
switch ($args[0]) {
1217+
"-installDependencies" {
1218+
Install-Chocolatey
1219+
InstallScoop
1220+
ConfigureScoop
1221+
Install-AdditionalSoftware
1222+
}
1223+
"-acquireFiles" {
1224+
AcquireFiles
1225+
}
1226+
"-setupRoms" {
1227+
Setup-Roms
1228+
Setup-EmulationStationConfig
1229+
Setup-DolphinConfig
1230+
Setup-Scraper
1231+
Setup-DesktopShortcuts
1232+
}
1233+
default {
1234+
# If no parameter is provided, execute all functions
1235+
Install-Chocolatey
1236+
InstallScoop
1237+
ConfigureScoop
1238+
Install-AdditionalSoftware
1239+
AcquireFiles
1240+
Install-EmulationStation
1241+
Setup-EmulatorCores
1242+
Start-RetroarchAndGenerateConfig
1243+
Setup-Roms
1244+
Setup-EmulationStationConfig
1245+
Setup-DolphinConfig
1246+
Setup-Scraper
1247+
Setup-DesktopShortcuts
1248+
}
1249+
}
12321250

12331251
# TO-DO: Review if this is still needed or not
12341252
# # https://www.ngemu.com/threads/epsxe-2-0-5-startup-crash-black-screen-fix-here.199169/

0 commit comments

Comments
 (0)