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

Function performCliSelfUpdate

apps/cli/src/update-checker.ts:179–188  ·  view source on GitHub ↗
(options: PerformCliSelfUpdateOptions = {})

Source from the content-addressed store, hash-verified

177}
178
179export function performCliSelfUpdate(options: PerformCliSelfUpdateOptions = {}): Promise<UpdateCommandResult> {
180 const platformName = options.platform ?? process.platform
181 const npmCmd = platformName === 'win32' ? 'npm.cmd' : 'npm'
182 const args = ['install', '-g', `${PACKAGE_NAME}@latest`]
183 const write = options.write ?? ((text) => process.stderr.write(text))
184 const runCommand = options.runCommand ?? ((command, commandArgs) => runNpmUpdateCommand(command, commandArgs, write))
185
186 write(`\n Running: ${npmCmd} ${args.join(' ')}\n\n`)
187 return runCommand(npmCmd, args)
188}
189
190function isDevEnvironment(): boolean {
191 if (process.env.CHATLAB_SKIP_UPDATE_CHECK) return true

Callers 3

cli.tsFile · 0.85

Calls 3

runNpmUpdateCommandFunction · 0.85
writeMethod · 0.65
writeFunction · 0.50

Tested by

no test coverage detected