MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / setVariable

Function setVariable

scripts/web-env/shared.ts:205–226  ·  view source on GitHub ↗
(
  context: VercelContext,
  environment: Environment,
  name: string,
  value: string,
  sensitive: boolean
)

Source from the content-addressed store, hash-verified

203 let settled = false;
204
205 const fail = (error: Error) => {
206 if (settled) return;
207 settled = true;
208 reject(error);
209 };
210 const capture = (chunk: Buffer, keep: boolean) => {
211 outputBytes += chunk.length;
212 if (outputBytes > 10 * 1024 * 1024) {
213 child.kill();
214 fail(
215 new Error(
216 `pnpm ${commandArgs.slice(0, 3).join(' ')} failed; provider output exceeded 10 MiB.`
217 )
218 );
219 return;
220 }
221 if (keep) stdout.push(chunk);
222 else stderr.push(chunk);
223 };
224
225 child.stdout.on('data', chunk => capture(Buffer.from(chunk), true));
226 child.stderr.on('data', chunk => capture(Buffer.from(chunk), false));
227 child.once('error', error => {
228 if (errorCode(error) === 'ENOENT') {
229 const message = missingCommandMessage('pnpm', commandArgs);

Callers 1

mainFunction · 0.85

Calls 1

vercelFunction · 0.85

Tested by

no test coverage detected