MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / runNpmUpdateCommand

Function runNpmUpdateCommand

apps/cli/src/update-checker.ts:161–177  ·  view source on GitHub ↗
(
  command: string,
  args: string[],
  write: (text: string) => void
)

Source from the content-addressed store, hash-verified

159}
160
161function runNpmUpdateCommand(
162 command: string,
163 args: string[],
164 write: (text: string) => void
165): Promise<UpdateCommandResult> {
166 return new Promise((resolve) => {
167 const child = execFile(command, args, { timeout: 120_000 }, (err, _stdout, stderr) => {
168 if (err) {
169 resolve({ success: false, error: stderr || err.message })
170 } else {
171 resolve({ success: true })
172 }
173 })
174 child.stdout?.on('data', (chunk) => write(String(chunk)))
175 child.stderr?.on('data', (chunk) => write(String(chunk)))
176 })
177}
178
179export function performCliSelfUpdate(options: PerformCliSelfUpdateOptions = {}): Promise<UpdateCommandResult> {
180 const platformName = options.platform ?? process.platform

Callers 1

performCliSelfUpdateFunction · 0.85

Calls 3

resolveFunction · 0.85
onMethod · 0.80
writeFunction · 0.50

Tested by

no test coverage detected