MCPcopy Index your code
hub / github.com/ChinaSiro/claude-code-sourcemap / Xe4

Function Xe4

package/cli.js:2122–2122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2120 claude update
2121
2122This will ensure you have access to the latest features and improvements.
2123`),eK(1)}catch(q){H6(q)}}async function I46(){return(await He4()).external||void 0}async function je4(){return(await He4()).external_message||void 0}async function He4(){try{return await gS("tengu_max_version_config",{})}catch(q){return H6(q),{}}}function ly6(q){let _=N7()?.minimumVersion;if(!_)return!1;let z=!yP(q,_);if(z)N(`Skipping update to ${q} - below minimumVersion ${_}`);return z}function Je4(){return zIz(c1(),".update.lock")}async function $Iz(){let q=X8(),K=Je4();try{let _=await q.stat(K);if(Date.now()-_.mtimeMs<Oe4)return!1;try{let Y=await q.stat(K);if(Date.now()-Y.mtimeMs<Oe4)return!1;await q.unlink(K)}catch(Y){if(!_7(Y))return H6(Y),!1}}catch(_){if(!_7(_))return H6(_),!1}try{return await Ae4(K,`${process.pid}`,{encoding:"utf8",flag:"wx"}),!0}catch(_){let z=s1(_);if(z==="EEXIST")return!1;if(z==="ENOENT")try{return await q.mkdir(c1()),await Ae4(K,`${process.pid}`,{encoding:"utf8",flag:"wx"}),!0}catch(Y){if(s1(Y)==="EEXIST")return!1;return H6(Y),!1}return H6(_),!1}}async function AIz(){let q=X8(),K=Je4();try{if(await q.readFile(K,{encoding:"utf8"})===`${process.pid}`)await q.unlink(K)}catch(_){if(_7(_))return;H6(_)}}async function OIz(){let q=a1.isRunningWithBun(),K=null;if(q)K=await S7("bun",["pm","bin","-g"],{cwd:St6()});else K=await S7("npm",["-g","config","get","prefix"],{cwd:St6()});if(K.code!==0)return H6(Error(`Failed to check ${q?"bun":"npm"} permissions`)),null;return K.stdout.trim()}async function il1(){try{let q=await OIz();if(!q)return{hasPermissions:!1,npmPrefix:null};try{return await _Iz(q,KIz.W_OK),{hasPermissions:!0,npmPrefix:q}}catch{return H6(new TS8("Insufficient permissions for global npm install.")),{hasPermissions:!1,npmPrefix:q}}}catch(q){return H6(q),{hasPermissions:!1,npmPrefix:null}}}async function L26(q){let K=q==="stable"?"stable":"latest",_=await S7("npm",["view",`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.88",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-03-30T21:59:52Z"}.PACKAGE_URL}@${K}`,"version","--prefer-online"],{abortSignal:AbortSignal.timeout(5000),cwd:St6()});if(_.code!==0){if(N(`npm view failed with code ${_.code}`),_.stderr)N(`npm stderr: ${_.stderr.trim()}`);else N("npm stderr: (empty)");if(_.stdout)N(`npm stdout: ${_.stdout.trim()}`);return null}return _.stdout.trim()}async function Me4(){let q=await S7("npm",["view",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.88",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-03-30T21:59:52Z"}.PACKAGE_URL,"dist-tags","--json","--prefer-online"],{abortSignal:AbortSignal.timeout(5000),cwd:St6()});if(q.code!==0)return N(`npm view dist-tags failed with code ${q.code}`),{latest:null,stable:null};try{let K=r8(q.stdout.trim());return{latest:typeof K.latest==="string"?K.latest:null,stable:typeof K.stable==="string"?K.stable:null}}catch(K){return N(`Failed to parse dist-tags: ${K}`),{latest:null,stable:null}}}async function vS8(q){try{return(await $1.get(`${YIz}/${q}`,{timeout:5000,responseType:"text"})).data.trim()}catch(K){return N(`Failed to fetch ${q} from GCS: ${K}`),null}}async function Xe4(){let[q,K]=await Promise.all([vS8("latest"),vS8("stable")]);return{latest:q,stable:K}}async function Ct6(q){if(!await $Iz())return H6(new TS8("Another process is currently installing an update")),d("tengu_auto_updater_lock_contention",{pid:process.pid,currentVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.88",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-03-30T21:59:52Z"}.VERSION}),"in_progress";try{if(await wIz(),!a1.isRunningWithBun()&&a1.isNpmFromWindowsPath())return H6(Error("Windows NPM detected in WSL environment")),d("tengu_auto_updater_windows_npm_in_wsl",{currentVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.88",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-03-30T21:59:52Z"}.VERSION}),console.error(`
2124Error: Windows NPM detected in WSL
2125

Callers

nothing calls this directly

Calls 1

vS8Function · 0.85

Tested by

no test coverage detected