MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / run

Function run

tooling/scripts/perf-web-runtime.mjs:107–125  ·  view source on GitHub ↗
(command, args, options = {})

Source from the content-addressed store, hash-verified

105}
106
107function run(command, args, options = {}) {
108 return new Promise((resolvePromise, rejectPromise) => {
109 const child = spawn(command, args, {
110 cwd: options.cwd ?? repoRoot,
111 env: options.env ?? process.env,
112 shell: options.shell ?? false,
113 stdio: options.stdio ?? 'inherit'
114 })
115
116 child.on('exit', (code) => {
117 if (code === 0) {
118 resolvePromise()
119 return
120 }
121 rejectPromise(new Error(`${command} ${args.join(' ')} exited with code ${code ?? 'unknown'}`))
122 })
123 child.on('error', rejectPromise)
124 })
125}
126
127async function getFreePort() {
128 return new Promise((resolvePromise, rejectPromise) => {

Callers 2

prepareWebDistFunction · 0.70
buildGoServerFunction · 0.70

Calls 1

onMethod · 0.45

Tested by

no test coverage detected