| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9f6bc58 commit 8010c83
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -870,11 +870,14 @@ function spawnWithSignal(file, args, options) { | |||
| 870 | 870 | const opts = options && typeof options === 'object' && ('signal' in options) ? | |
| 871 | 871 | { ...options, signal: undefined } : | |
| 872 | 872 | options; | |
| 873 | - const child = spawn(file, args, opts); | ||
| 874 | 873 | ||
| 875 | - if (options && options.signal) { | ||
| 874 | + if (options?.signal) { | ||
| 876 | 875 | // Validate signal, if present | |
| 877 | 876 | validateAbortSignal(options.signal, 'options.signal'); | |
| 877 | + } | ||
| 878 | + const child = spawn(file, args, opts); | ||
| 879 | + | ||
| 880 | + if (options && options.signal) { | ||
| 878 | 881 | function kill() { | |
| 879 | 882 | if (child._handle) { | |
| 880 | 883 | child._handle.kill(options.killSignal || 'SIGTERM'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments