Skip to content

Commit

Permalink
Always respect select flag during install
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanBettermannDD committed Jul 20, 2023
1 parent 71e97f8 commit b24a932
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/xcodes/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@ struct Xcodes: AsyncParsableCommand {
return xcodeInstaller.install(installation, dataSource: globalDataSource.dataSource, downloader: downloader, destination: destination, experimentalUnxip: experimentalUnxip, emptyTrash: emptyTrash, noSuperuser: noSuperuser)
}
}
.recover { error -> Promise<InstalledXcode> in
if select, case let XcodeInstaller.Error.versionAlreadyInstalled(installedXcode) = error {
Current.logging.log(error.legibleLocalizedDescription.green)
return Promise { seal in
seal.fulfill(installedXcode)
}
} else {
throw error
}
}
.then { xcode -> Promise<Void> in
if select {
return selectXcode(shouldPrint: print, pathOrVersion: xcode.path.string, directory: destination, fallbackToInteractive: false)
Expand Down

0 comments on commit b24a932

Please sign in to comment.