diff --git a/Sources/Shwift/Context.swift b/Sources/Shwift/Context.swift index 40efadb..d9d07be 100644 --- a/Sources/Shwift/Context.swift +++ b/Sources/Shwift/Context.swift @@ -58,7 +58,7 @@ private final class NullDeviceHandler: ChannelInboundHandler { private final class FatalDeviceHandler: ChannelInboundHandler { typealias InboundIn = ByteBuffer func channelRead(context: ChannelHandlerContext, data: NIOAny) { - fatalError() + fatalError(String(buffer: unwrapInboundIn(data))) } } diff --git a/Sources/Shwift/Process.swift b/Sources/Shwift/Process.swift index 4576179..41a9e96 100644 --- a/Sources/Shwift/Process.swift +++ b/Sources/Shwift/Process.swift @@ -190,6 +190,11 @@ public struct Process { break } + /** + If the task has been cancelled, we want cancellation to supercede the temination status of the executable (often a SIGTERM). + */ + try Task.checkCancellation() + switch Int(info.si_code) { case Int(CLD_EXITED): let terminationStatus = info[keyPath: sigchldInfo].si_status diff --git a/Support/VSCode/.gitignore b/Support/VSCode/.gitignore new file mode 100644 index 0000000..450a234 --- /dev/null +++ b/Support/VSCode/.gitignore @@ -0,0 +1 @@ +launch.json diff --git a/Support/VSCode/launch.json b/Support/VSCode/launch.json deleted file mode 100644 index 358a151..0000000 --- a/Support/VSCode/launch.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "type": "lldb", - "request": "launch", - "name": "Tests", - "program": "${workspaceFolder}/.build/x86_64-unknown-linux-gnu/debug/ShwiftPackageTests.xctest", - "cwd": "${workspaceFolder}", - "preLaunchTask": "Build", - }, - { - "type": "lldb", - "request": "launch", - "name": "Script Example", - "program": "${workspaceFolder}/.build/x86_64-unknown-linux-gnu/debug/ScriptExample", - "cwd": "${workspaceFolder}", - "preLaunchTask": "Build", - }, - ] -} \ No newline at end of file