()
| 151 | } |
| 152 | |
| 153 | async 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 | |
| 175 | export async function isGlobal(): Promise<boolean> { |
| 176 | try { |
no test coverage detected