Skip to content

Commit c75dda3

Browse files
authored
Merge pull request #310 from DylanBettermannDD/db/select-after-install
Always respect select flag during install
2 parents bbe71da + b24a932 commit c75dda3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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)