Skip to content

Commit 39b52c1

Browse files
committed
Cleanup shadow/link
1 parent 0f80cb0 commit 39b52c1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/shadow/link.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import cmdShim from 'cmd-shim'
55
import constants from '../constants'
66
import { findBinPathDetails } from '../utils/path-resolve'
77

8-
const { WIN32, rootDistPath } = constants
9-
108
export async function installLinks(
119
realBinPath: string,
1210
binName: 'npm' | 'npx'
@@ -21,6 +19,8 @@ export async function installLinks(
2119
)
2220
process.exit(127)
2321
}
22+
// Lazily access constants.WIN32.
23+
const { WIN32 } = constants
2424
// TODO: Is this early exit needed?
2525
if (WIN32 && binPath) {
2626
return binPath
@@ -29,7 +29,8 @@ export async function installLinks(
2929
if (!shadowed) {
3030
if (WIN32) {
3131
await cmdShim(
32-
path.join(rootDistPath, `${binName}-cli.js`),
32+
// Lazily access constants.rootDistPath.
33+
path.join(constants.rootDistPath, `${binName}-cli.js`),
3334
path.join(realBinPath, binName)
3435
)
3536
}

0 commit comments

Comments
 (0)