MCPcopy Create free account
hub / github.com/vercel/vercel / resolveInstall

Function resolveInstall

packages/cli/src/util/get-update-command.ts:153–173  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151}
152
153async function resolveInstall() {
154 const pkg = isNativeBinaryInstall() ? nativePackageName : packageName;
155 const installPath = await realpath(resolve(__dirname));
156
157 const globalCliType = await detectGlobalCliType(installPath, pkg);
158 if (globalCliType) {
159 return { cliType: globalCliType, global: true };
160 }
161
162 const entrypoint = await realpath(process.argv[1]);
163 const { cliType, lockfilePath } = await scanParentDirs(
164 dirname(dirname(entrypoint))
165 );
166
167 return {
168 // Global installs for npm do not have a lockfile
169 cliType: lockfilePath ? cliType : 'npm',
170 global:
171 isGlobalByPath(installPath) || (await isGlobalByPrefix(installPath)),
172 };
173}
174
175export async function isGlobal(): Promise<boolean> {
176 try {

Callers 2

isGlobalFunction · 0.85
getUpdateCommandInfoFunction · 0.85

Calls 6

isNativeBinaryInstallFunction · 0.90
scanParentDirsFunction · 0.90
detectGlobalCliTypeFunction · 0.85
isGlobalByPathFunction · 0.85
isGlobalByPrefixFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected