Skip to content

Commit

Permalink
Merge pull request #310 from DylanBettermannDD/db/select-after-install
Browse files Browse the repository at this point in the history
Always respect select flag during install
  • Loading branch information
MattKiazyk authored Feb 16, 2024
2 parents bbe71da + b24a932 commit c75dda3
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 c75dda3

Please sign in to comment.