Skip to content

Commit 91dc698

Browse files
John ButeJohn Bute
authored andcommitted
fixed formatting and added defer
1 parent 9826fc2 commit 91dc698

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/Swiftly/Init.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ internal struct Init: SwiftlyCommand {
9393
SwiftlyCore.print(" \(swiftlyBinDir.appendingPathComponent(executable).path)")
9494
}
9595

96-
guard promptForConfirmation(defaultBehavior: false) else {
96+
guard SwiftlyCore.promptForConfirmation(defaultBehavior: false) else {
9797
throw SwiftlyError(message: "Swiftly installation has been cancelled")
9898
}
9999
}

Sources/SwiftlyCore/Platform.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ extension Platform {
211211
}
212212
process.waitUntilExit()
213213

214-
if pgid != -1 {
214+
defer { if pgid != -1 {
215215
tcsetpgrp(STDOUT_FILENO, pgid)
216-
}
216+
}}
217217

218218
guard process.terminationStatus == 0 else {
219219
throw RunProgramError(exitCode: process.terminationStatus, program: args.first!)
@@ -258,9 +258,9 @@ extension Platform {
258258

259259
process.waitUntilExit()
260260

261-
if pgid != -1 {
261+
defer { if pgid != -1 {
262262
tcsetpgrp(STDOUT_FILENO, pgid)
263-
}
263+
}}
264264

265265
guard process.terminationStatus == 0 else {
266266
throw RunProgramError(exitCode: process.terminationStatus, program: args.first!)

0 commit comments

Comments
 (0)