From d56d2177906fe46011a346c8a6139d1f43861ca3 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 14 Sep 2023 10:52:18 -0700 Subject: [PATCH] [Fix] fix `npx resolve` by handling symlinks (#315) Fixes #315 --- bin/resolve | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/resolve b/bin/resolve index 5ee329a..4c1884a 100755 --- a/bin/resolve +++ b/bin/resolve @@ -11,7 +11,7 @@ if ( !process.argv || process.argv.length < 2 || (process.argv[1] !== __filename && fs.statSync(process.argv[1]).ino !== fs.statSync(__filename).ino) - || (process.env._ && path.resolve(process.env._) !== __filename) + || (process.env._ && fs.realpathSync(path.resolve(process.env._)) !== __filename) ) ) { console.error('Error: `resolve` must be run directly as an executable');