Skip to content

Commit

Permalink
feat: provide spawnSync configuration (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Mar 18, 2024
1 parent 1f8c8b8 commit 1d8aa93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core.ts
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

import assert from 'node:assert'
import { spawn, StdioNull, StdioPipe } from 'node:child_process'
import { spawn, spawnSync, StdioNull, StdioPipe } from 'node:child_process'
import { AsyncLocalStorage, createHook } from 'node:async_hooks'
import { Readable, Writable } from 'node:stream'
import { inspect } from 'node:util'
Expand Down Expand Up @@ -65,6 +65,7 @@ export interface Options {
quote: typeof quote
quiet: boolean
spawn: typeof spawn
spawnSync: typeof spawnSync
log: typeof log
}

Expand Down Expand Up @@ -92,6 +93,7 @@ export const defaults: Options = {
throw new Error('No quote function is defined: https://ï.at/no-quote-func')
},
spawn,
spawnSync,
log,
}
const isWin = process.platform == 'win32'
Expand Down Expand Up @@ -238,6 +240,7 @@ export class ProcessPromise extends Promise<ProcessOutput> {
shell: typeof $.shell === 'string' ? $.shell : true,
env: $.env,
spawn: $.spawn,
spawnSync: $.spawnSync,
stdio: this._stdio as any,
sync: $[syncExec],
detached: !isWin,
Expand Down

0 comments on commit 1d8aa93

Please sign in to comment.