Skip to content

Commit 6956020

Browse files
committed
Remove undefined realpath stub file and use the native variant
1 parent 99b086a commit 6956020

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/constants.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ const lazyRootDistPath = () =>
108108
const lazyRootPath = () =>
109109
// The '@rollup/plugin-replace' will replace 'process.env.TAP' with `false` and
110110
// it will be dead code eliminated by Rollup.
111-
path.resolve(realpathSync(__dirname), process.env['TAP'] ? '../..' : '..')
111+
path.resolve(
112+
realpathSync.native(__dirname),
113+
process.env['TAP'] ? '../..' : '..'
114+
)
112115

113116
const lazyRootPkgJsonPath = () =>
114117
// Lazily access constants.rootPath.

src/shadow/npm-paths.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { findRoot } from '../utils/path-resolve'
77

88
const { NODE_MODULES, SOCKET_CLI_ISSUES_URL } = constants
99

10-
const npmEntrypoint = realpathSync(process.argv[1]!)
10+
const npmEntrypoint = realpathSync.native(process.argv[1]!)
1111
const npmRootPath = findRoot(path.dirname(npmEntrypoint))
1212
if (npmRootPath === undefined) {
1313
console.error(

test/socket-npm-fixtures/lacking-typosquat/undefined

Whitespace-only changes.

0 commit comments

Comments
 (0)