Skip to content

Commit b24a932

Browse files
Always respect select flag during install
1 parent 71e97f8 commit b24a932

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Sources/xcodes/App.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,16 @@ struct Xcodes: AsyncParsableCommand {
290290
return xcodeInstaller.install(installation, dataSource: globalDataSource.dataSource, downloader: downloader, destination: destination, experimentalUnxip: experimentalUnxip, emptyTrash: emptyTrash, noSuperuser: noSuperuser)
291291
}
292292
}
293+
.recover { error -> Promise<InstalledXcode> in
294+
if select, case let XcodeInstaller.Error.versionAlreadyInstalled(installedXcode) = error {
295+
Current.logging.log(error.legibleLocalizedDescription.green)
296+
return Promise { seal in
297+
seal.fulfill(installedXcode)
298+
}
299+
} else {
300+
throw error
301+
}
302+
}
293303
.then { xcode -> Promise<Void> in
294304
if select {
295305
return selectXcode(shouldPrint: print, pathOrVersion: xcode.path.string, directory: destination, fallbackToInteractive: false)

0 commit comments

Comments
 (0)