Skip to content

Commit e076b0f

Browse files
committed
Revert change that prevented install tests from actually installing
1 parent d6e7e68 commit e076b0f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Sources/Swiftly/Use.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ struct Use: SwiftlyCommand {
110110
}
111111

112112
try await Self.execute(ctx, toolchain, globalDefault: self.globalDefault, assumeYes: self.root.assumeYes, &config)
113-
114113
}
115114

116115
/// Use a toolchain. This method can modify and save the input config and also create/modify a `.swift-version` file.

Sources/SwiftlyCore/Platform.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,16 @@ extension Platform {
454454
return cmdAbsolute
455455
}
456456

457+
// If we're running inside an xctest then we don't have a location for this swiftly.
458+
guard let cmdAbsolute,
459+
!(
460+
(cmdAbsolute.string.hasSuffix("xctest") || cmdAbsolute.string.hasSuffix("swiftpm-testing-helper"))
461+
&& CommandLine.arguments.contains { $0.contains("InstallTests") }
462+
)
463+
else {
464+
return nil
465+
}
466+
457467
return try await fs.exists(atPath: swiftlyHomeBin) ? swiftlyHomeBin : nil
458468
}
459469

0 commit comments

Comments
 (0)