Skip to content

Commit 77f586e

Browse files
committed
Fix to ignore empty .xcode-version
1 parent 3623b29 commit 77f586e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Sources/XcCommand/Subcommands/Open.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ extension XcCommand {
5555
var specifier = specifierOptions.specifier
5656
if case .nil = specifier {
5757
let xcodeVersion = (try? XcodeVersion.string) ?? .init()
58-
specifier = try .init(expressionString: xcodeVersion)
58+
if !xcodeVersion.isEmpty {
59+
specifier = try .init(expressionString: xcodeVersion)
60+
}
5961
}
6062
guard let xcode = xcodes.filter(licenseTypes: licenseTypes).filter(specifier: specifier).sorted(specifier: specifier).first
6163
else {

Sources/XcCommand/Subcommands/Run.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ extension XcCommand {
3636
var specifier = specifierOptions.specifier
3737
if case .nil = specifier {
3838
let xcodeVersion = (try? XcodeVersion.string) ?? .init()
39-
specifier = try .init(expressionString: xcodeVersion)
39+
if !xcodeVersion.isEmpty {
40+
specifier = try .init(expressionString: xcodeVersion)
41+
}
4042
}
4143
guard
4244
let xcode =

0 commit comments

Comments
 (0)