()
| 167 | * update command can surface a friendlier message for local/dev installs. |
| 168 | */ |
| 169 | export 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 | |
| 178 | function resolveEntrypoint(): string { |
| 179 | const argvPath = process.argv[1]; |
no test coverage detected