()
| 127 | // --- Install method detection --- |
| 128 | |
| 129 | export function collectCandidatePaths(): string[] { |
| 130 | const candidates: string[] = []; |
| 131 | |
| 132 | if (process.argv[1]) { |
| 133 | candidates.push(process.argv[1]); |
| 134 | try { |
| 135 | candidates.push(fs.realpathSync(process.argv[1])); |
| 136 | } catch { |
| 137 | // Symlink resolution may fail |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | if (process.execPath) { |
| 142 | candidates.push(process.execPath); |
| 143 | try { |
| 144 | candidates.push(fs.realpathSync(process.execPath)); |
| 145 | } catch { |
| 146 | // Skip |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | return candidates; |
| 151 | } |
| 152 | |
| 153 | export function detectInstallMethodFromPaths( |
| 154 | pkgName: string, |
no test coverage detected