MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / isGlobalInstall

Function isGlobalInstall

src/utils/updateCheck.ts:169–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167 * update command can surface a friendlier message for local/dev installs.
168 */
169export function isGlobalInstall(): boolean {
170 // argv[1] is whatever the shell handed to node, which is the *symlink* path
171 // (`<prefix>/bin/orbcode`) for a global npm install — not the real file. We
172 // have to resolve symlinks; otherwise the `node_modules/@matterailab/...`
173 // substring never appears and a perfectly valid global install looks local.
174 const here = resolveEntrypoint();
175 return /node_modules[\\/]@matterailab[\\/]orbcode/.test(here);
176}
177
178function resolveEntrypoint(): string {
179 const argvPath = process.argv[1];

Callers 1

runUpdateFunction · 0.85

Calls 1

resolveEntrypointFunction · 0.85

Tested by

no test coverage detected