MCPcopy
hub / github.com/electron-userland/electron-builder / spawnAndWrite

Function spawnAndWrite

packages/builder-util/src/util.ts:184–206  ·  view source on GitHub ↗
(command: string, args: Array<string>, data: string, options?: SpawnOptions)

Source from the content-addressed store, hash-verified

182}
183
184export function spawnAndWrite(command: string, args: Array<string>, data: string, options?: SpawnOptions) {
185 const childProcess = doSpawn(command, args, options, {isPipeInput: true})
186 const timeout = setTimeout(() => childProcess.kill(), 4 * 60 * 1000)
187 return new Promise<any>((resolve, reject) => {
188 handleProcess("close", childProcess, command, () => {
189 try {
190 clearTimeout(timeout)
191 }
192 finally {
193 resolve()
194 }
195 }, error => {
196 try {
197 clearTimeout(timeout)
198 }
199 finally {
200 reject(error.stack || error.toString())
201 }
202 })
203
204 childProcess.stdin.end(data)
205 })
206}
207
208export function spawn(command: string, args?: Array<string> | null, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any> {
209 return new Promise<any>((resolve, reject) => {

Callers 1

executeMakensisMethod · 0.90

Calls 4

doSpawnFunction · 0.85
handleProcessFunction · 0.85
endMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…