diff --git a/Sources/RocketLib/Executors/SwiftScriptExecutor.swift b/Sources/RocketLib/Executors/SwiftScriptExecutor.swift index 9b155c1..83aec50 100644 --- a/Sources/RocketLib/Executors/SwiftScriptExecutor.swift +++ b/Sources/RocketLib/Executors/SwiftScriptExecutor.swift @@ -11,20 +11,19 @@ final class SwiftScriptExecutor: DefaultExecutor { return } - let supportedSwiftCPaths = ["/usr/bin/swiftc", "/home/travis/.swiftenv/shims/swiftc"] + let supportedSwiftPaths = ["/usr/bin/swift", "/home/travis/.swiftenv/shims/swift"] - let swiftCPath = supportedSwiftCPaths.first { fileManager.fileExists(atPath: $0) } - let swiftC = swiftCPath ?? "swiftc" + let swiftPath = supportedSwiftPaths.first { fileManager.fileExists(atPath: $0) } + let swift = swiftPath ?? "swift" let args = [ - "--driver-mode=swift", scriptPath, version, ] + parameters.arguments - logger.logInfo("Running: \(swiftC) \(args.joined(separator: " "))") + logger.logInfo("Running: \(swift) \(args.joined(separator: " "))") let process = Process() - process.launchPath = swiftC + process.launchPath = swift process.arguments = args let standardOutput = FileHandle.standardOutput diff --git a/Tests/RocketTests/SwiftScriptExecutorTests.swift b/Tests/RocketTests/SwiftScriptExecutorTests.swift index a17e84c..0c0f577 100644 --- a/Tests/RocketTests/SwiftScriptExecutorTests.swift +++ b/Tests/RocketTests/SwiftScriptExecutorTests.swift @@ -15,9 +15,8 @@ final class SwiftScriptExecutorTests: XCTestCase { executor.executeStep(version: "1.0.0", logger: Logger.testLogger) - expect(processLauncher.receivedProcess?.launchPath) == "/usr/bin/swiftc" + expect(processLauncher.receivedProcess?.launchPath) == "/usr/bin/swift" expect(processLauncher.receivedProcess?.arguments) == [ - "--driver-mode=swift", testPath, "1.0.0", ]