MCPcopy
hub / github.com/danger/danger-js / sendDSLToSubprocess

Function sendDSLToSubprocess

source/commands/utils/runDangerSubprocess.ts:56–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 const child = spawn(processName, args, { env: { ...process.env, ...config.additionalEnvVars } })
55
56 const sendDSLToSubprocess = () => {
57 if (exec.options.passURLForDSL) {
58 const filename = `danger-dsl-${randomBytes(4).toString("hex")}.json`
59 const resultsPath = join(tmpdir(), filename)
60 writeFileSync(resultsPath, dslJSONString, "utf8")
61 const url = `danger://dsl/${resultsPath}`
62 d(`Started passing in STDIN via the URL: ${url}`)
63 child.stdin.write(url)
64 child.stdin.end()
65 } else {
66 d(`Started passing in STDIN`)
67 child.stdin.write(dslJSONString)
68 child.stdin.end()
69 }
70 d(`Passed DSL in via STDIN`)
71 }
72
73 // Initial sending of the DSL
74 sendDSLToSubprocess()

Callers 1

runDangerSubprocessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected