@@ -18,7 +18,7 @@ struct LauncherView: View {
1818 @FetchRequest ( sortDescriptors: [ SortDescriptor ( \. title) ] ) var launcherRepos : FetchedResults < LauncherRepos >
1919 @State var existingRepo = URL ( string: " " )
2020 @State var repoTitle = " "
21- @State var currentVersion = " v1.2.0 \n "
21+ @State var currentVersion = " v1.2.1 \n "
2222 @State var updateAlert = false
2323 @State var latestVersion = " "
2424 @State var repoArgs = " "
@@ -31,6 +31,7 @@ struct LauncherView: View {
3131 @State var romURL = URL ( string: " " )
3232 @State var crashIndex = 0
3333 @State var logIndex = 0
34+ @State var homebrewText = " "
3435 let sm64 : UTType = . init( filenameExtension: " f3dex2e " ) ?? UTType . unixExecutable
3536 let rom : UTType = . init( filenameExtension: " z64 " ) ?? UTType . unixExecutable
3637
@@ -281,12 +282,10 @@ struct LauncherView: View {
281282
282283 romURL = showOpenPanelForRom ( )
283284
284- romURL? = URL ( fileURLWithPath: romURL? . path. replacingOccurrences ( of: " " , with: " \\ " ) ?? " " )
285+ romURL? = URL ( fileURLWithPath: romURL? . path. replacingOccurrences ( of: " " , with: #"\ "#
286+ , options: . literal, range: nil ) ?? " " )
285287
286- print ( romURL? . path ?? " " )
287- print ( romURL? . pathExtension ?? " " )
288-
289- print ( try ? shell. shell ( " cp \( romURL? . path ?? " " ) ~/SM64Repos/baserom.us.z64 " ) ?? " " )
288+ print ( try ? shell. shell ( " cp \( romURL? . path ?? " " ) ~/SM64Repos/baserom.us.z64 " ) )
290289
291290 if let doesExist = try ? checkRom ( " ls ~/SM64Repos/baserom.us.z64 " ) {
292291 if doesExist {
@@ -345,10 +344,7 @@ struct LauncherView: View {
345344 }
346345 }
347346
348- Text ( " Homebrew is REQUIRED for this software to work, please install homebrew at brew.sh " )
349- . padding ( . horizontal)
350-
351- Text ( " \n Optional: Homebrew Intel version is nice to have. Install by launching terminal with Rosetta and installing at brew.sh " )
347+ Text ( homebrewText)
352348 . padding ( . horizontal)
353349
354350 Button ( action: {
@@ -383,11 +379,28 @@ struct LauncherView: View {
383379 Text ( " Install Dependencies " )
384380 } . buttonStyle ( . bordered) . padding ( . vertical)
385381 }
386-
387382 } . onAppear {
388383
389384 devMode = false
390385
386+ let detectArmBrewInstall = try ? shell. shell ( " which brew " )
387+ let detectIntelBrewInstall = try ? shell. shell ( " which /usr/local/bin/brew " )
388+
389+ if detectArmBrewInstall? . contains ( " /opt/homebrew/bin/brew " ) ?? false && detectIntelBrewInstall == " /usr/local/bin/brew \n " {
390+ homebrewText = " Both versions of homebrew are installed. "
391+ }
392+ else if !( detectArmBrewInstall? . contains ( " /opt/homebrew/bin/brew " ) ?? false ) && detectIntelBrewInstall == " /usr/local/bin/brew \n " {
393+
394+ homebrewText = " Arm homebrew is not installed. Please install at brew.sh \n \n Intel homebrew is installed "
395+ }
396+ else if ( detectArmBrewInstall? . contains ( " /opt/homebrew/bin/brew " ) ?? false ) && detectIntelBrewInstall != " /usr/local/bin/brew \n " {
397+
398+ homebrewText = " Arm homebrew is installed \n \n Intel homebrew is not installed. Install by launching your terminal with rosetta, and then follow instructions at brew.sh "
399+ }
400+ else {
401+ homebrewText = " Homebrew is not installed, please install at brew.sh "
402+ }
403+
391404 do {
392405 if try checkRom ( " ls ~/SM64Repos/baserom.us.z64 " ) {
393406 allowAddingRepos = true
0 commit comments