Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
macos-5.5:
@echo
@echo === Building $@ ===
env DEVELOPER_DIR=/Applications/Xcode-13.2.1.app xcrun swift build

macos-5.6:
@echo
@echo === Building $@ ===
env DEVELOPER_DIR=/Applications/Xcode-13.4.1.app xcrun swift build

macos-5.7:
@echo
@echo === Building $@ ===
env DEVELOPER_DIR=/Applications/Xcode-14.2.0.app xcrun swift build

linux-5.5:
@echo
@echo === Building $@ ===
docker run --rm -v "$(PWD)":/host -w /host "swift:5.5-focal" swift build

linux-5.6:
@echo
@echo === Building $@ ===
docker run --rm -v "$(PWD)":/host -w /host "swift:5.6-focal" swift build

linux-5.7:
@echo
@echo === Building $@ ===
docker run --rm -v "$(PWD)":/host -w /host "swift:5.7-focal" swift build

linux: \
linux-5.5 \
linux-5.6 \
linux-5.7

macos: \
macos-5.5 \
macos-5.6 \
macos-5.7

all: \
macos \
linux
8 changes: 8 additions & 0 deletions Sources/ShellOut.swift
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,11 @@ extension ShellOutCommand {

private extension Process {
@discardableResult func launchBash(with command: String, outputHandle: FileHandle? = nil, errorHandle: FileHandle? = nil, environment: [String : String]? = nil) throws -> String {
#if os(Linux)
executableURL = URL(fileURLWithPath: "/bin/bash")
#else
launchPath = "/bin/bash"
#endif
arguments = ["-c", command]

if let environment = environment {
Expand Down Expand Up @@ -438,7 +442,11 @@ private extension Process {
}
#endif

#if os(Linux)
try run()
#else
launch()
#endif

#if os(Linux)
outputQueue.sync {
Expand Down