Skip to content

Commit 0830525

Browse files
committed
Better global use test
1 parent 2b3c5ec commit 0830525

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

Diff for: prepare.ps1

+21-18
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@ $global:citraInstallDir = $null
44
$global:ppssppInstallDir = $null
55
$global:yuzuInstallDir = $null
66
$global:rpcs3InstallDir = $null
7-
$global:requirementsFolder = $null
8-
$global:retroarchExecutable = $null
9-
$global:retroarchConfigPath = $null
7+
$global:requirementsFolder = "$PSScriptRoot\requirements"
8+
# $global:retroarchExecutable = $null
9+
# $global:retroarchConfigPath = $null
10+
$global:retroArchPath = "$env:userprofile\.emulationstation\systems\retroarch\"
11+
# $global:retroArchPath = $null
12+
$global:retroarchExecutable = "$global:retroArchPath\retroarch.exe"
13+
$global:retroarchConfigPath = "$global:retroArchPath\retroarch.cfg"
1014

11-
$global:retroArchPath = $null
12-
$global:coresPath = $null
13-
$global:retroArchBinary = $null
14-
$global:romPath = $null
15+
$global:coresPath = "$global:retroArchPath\cores"
16+
$global:retroArchBinary = "$global:requirementsFolder\RetroArch.7z"
17+
18+
# $global:coresPath = $null
19+
# $global:retroArchBinary = $null
20+
# $global:romPath = $null
21+
$global:romPath = "$env:userprofile\.emulationstation\roms"
1522

1623

1724
function DownloadFiles {
@@ -151,10 +158,6 @@ function ConfigureScoop {
151158
scoop install yuzu
152159
scoop install rpcs3
153160

154-
$global:citraInstallDir = "$env:userprofile\scoop\apps\citra\current"
155-
$global:ppssppInstallDir = "$env:userprofile\scoop\apps\ppsspp\current"
156-
$global:yuzuInstallDir = "$env:userprofile\scoop\apps\yuzu\current"
157-
$global:rpcs3InstallDir = "$env:userprofile\scoop\apps\rpcs3\current"
158161
}
159162

160163
function Install-AdditionalSoftware {
@@ -164,7 +167,6 @@ function Install-AdditionalSoftware {
164167
}
165168

166169
function AcquireFiles {
167-
$global:requirementsFolder = "$PSScriptRoot\requirements"
168170
New-Item -ItemType Directory -Force -Path $global:requirementsFolder
169171
DownloadFiles("downloads")
170172
DownloadFiles("other_downloads")
@@ -188,9 +190,7 @@ function Install-EmulationStation {
188190

189191
function Setup-EmulatorCores {
190192
# Retroarch Setup
191-
$global:retroArchPath = "$env:userprofile\.emulationstation\systems\retroarch\"
192-
$global:coresPath = "$global:retroArchPath\cores"
193-
$global:retroArchBinary = "$global:requirementsFolder\RetroArch.7z"
193+
194194

195195
if(Test-Path $global:retroArchBinary){
196196
New-Item -ItemType Directory -Force -Path $global:retroArchPath
@@ -269,8 +269,6 @@ function Setup-EmulatorCore([string]$coreName, [string]$zipFileName) {
269269

270270
function Start-RetroarchAndGenerateConfig {
271271
# Start Retroarch and generate a config.
272-
$global:retroarchExecutable = "$global:retroArchPath\retroarch.exe"
273-
$global:retroarchConfigPath = "$global:retroArchPath\retroarch.cfg"
274272

275273
if (Test-Path $global:retroarchExecutable) {
276274

@@ -319,7 +317,7 @@ function Start-RetroarchAndGenerateConfig {
319317

320318
function Setup-Roms {
321319
# Add roms
322-
$global:romPath = "$env:userprofile\.emulationstation\roms"
320+
323321
New-Item -ItemType Directory -Force -Path $global:romPath | Out-Null
324322

325323
# Path creation + Open-Source / Freeware Rom population
@@ -621,6 +619,11 @@ function Setup-Roms {
621619

622620
function Setup-EmulationStationConfig {
623621

622+
$global:citraInstallDir = "$env:userprofile\scoop\apps\citra\current"
623+
$global:ppssppInstallDir = "$env:userprofile\scoop\apps\ppsspp\current"
624+
$global:yuzuInstallDir = "$env:userprofile\scoop\apps\yuzu\current"
625+
$global:rpcs3InstallDir = "$env:userprofile\scoop\apps\rpcs3\current"
626+
624627
Write-Host "INFO: Setting up Emulation Station Config"
625628
$esConfigFile = "$env:userprofile\.emulationstation\es_systems.cfg"
626629

0 commit comments

Comments
 (0)