Skip to content
Merged
1 change: 1 addition & 0 deletions Sources/Swiftly/Init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ internal struct Init: SwiftlyCommand {
These locations can be changed with SWIFTLY_HOME and SWIFTLY_BIN environment variables and run this again.
\(installMsg)
""")

guard SwiftlyCore.promptForConfirmation(defaultBehavior: true) else {
throw SwiftlyError(message: "Swiftly installation has been cancelled")
}
Expand Down
9 changes: 9 additions & 0 deletions Sources/SwiftlyCore/Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ extension Platform {
if pgid != -1 {
tcsetpgrp(STDOUT_FILENO, process.processIdentifier)
}

defer { if pgid != -1 {
tcsetpgrp(STDOUT_FILENO, pgid)
}}

process.waitUntilExit()

guard process.terminationStatus == 0 else {
Expand Down Expand Up @@ -250,6 +255,10 @@ extension Platform {
if pgid != -1 {
tcsetpgrp(STDOUT_FILENO, process.processIdentifier)
}
defer { if pgid != -1 {
tcsetpgrp(STDOUT_FILENO, pgid)
}}

let outData = try outPipe.fileHandleForReading.readToEnd()

process.waitUntilExit()
Expand Down