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

Function resolveEntrypoint

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

Source from the content-addressed store, hash-verified

176}
177
178function resolveEntrypoint(): string {
179 const argvPath = process.argv[1];
180 if (argvPath) {
181 try {
182 return fs.realpathSync(argvPath);
183 } catch {
184 // fall through to import.meta.url
185 }
186 }
187 // import.meta.url is the real file:// URL of the running module, which
188 // already points inside node_modules for a global install.
189 if (typeof import.meta.url === "string" && import.meta.url) {
190 return import.meta.url;
191 }
192 return "";
193}
194
195/** Best-effort: run `npm root -g` so we can show the install location. */
196export async function getGlobalInstallRoot(): Promise<string | null> {

Callers 1

isGlobalInstallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected