Skip to content

Commit 1d8aa93

Browse files
authored
feat: provide spawnSync configuration (google#739)
1 parent 1f8c8b8 commit 1d8aa93

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
import assert from 'node:assert'
16-
import { spawn, StdioNull, StdioPipe } from 'node:child_process'
16+
import { spawn, spawnSync, StdioNull, StdioPipe } from 'node:child_process'
1717
import { AsyncLocalStorage, createHook } from 'node:async_hooks'
1818
import { Readable, Writable } from 'node:stream'
1919
import { inspect } from 'node:util'
@@ -65,6 +65,7 @@ export interface Options {
6565
quote: typeof quote
6666
quiet: boolean
6767
spawn: typeof spawn
68+
spawnSync: typeof spawnSync
6869
log: typeof log
6970
}
7071

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

0 commit comments

Comments
 (0)