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

Function run

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

Source from the content-addressed store, hash-verified

118}
119
120function run(command, args, options = {}) {
121 return new Promise((resolvePromise, rejectPromise) => {
122 const child = spawn(command, args, {
123 cwd: options.cwd ?? repoRoot,
124 env: options.env ?? process.env,
125 shell: options.shell ?? false,
126 stdio: options.stdio ?? 'inherit'
127 })
128 child.on('exit', (code) => {
129 if (code === 0) {
130 resolvePromise()
131 return
132 }
133 rejectPromise(new Error(`${command} ${args.join(' ')} exited with code ${code ?? 'unknown'}`))
134 })
135 child.on('error', rejectPromise)
136 })
137}
138
139async function getFreePort() {
140 return new Promise((resolvePromise, rejectPromise) => {

Callers 1

prepareDesktopBuildFunction · 0.70

Calls 1

onMethod · 0.45

Tested by

no test coverage detected