@pnpm/link-bins
Advanced tools
Comparing version 7.2.7 to 7.2.8
@@ -40,2 +40,3 @@ "use strict"; | ||
const cmd_shim_1 = __importDefault(require("@zkochan/cmd-shim")); | ||
const rimraf_1 = __importDefault(require("@zkochan/rimraf")); | ||
const is_subdir_1 = __importDefault(require("is-subdir")); | ||
@@ -161,2 +162,9 @@ const is_windows_1 = __importDefault(require("is-windows")); | ||
const externalBinPath = path_1.default.join(binsDir, cmd.name); | ||
if (IS_WINDOWS) { | ||
const exePath = path_1.default.join(binsDir, `${cmd.name}${getExeExtension()}`); | ||
if ((0, fs_1.existsSync)(exePath)) { | ||
(0, logger_1.globalWarn)(`The target bin directory already contains an exe called ${cmd.name}, so removing ${exePath}`); | ||
await (0, rimraf_1.default)(exePath); | ||
} | ||
} | ||
if (opts?.preferSymlinkedExecutables && !IS_WINDOWS && cmd.nodeExecPath == null) { | ||
@@ -186,2 +194,11 @@ await (0, symlink_dir_1.default)(cmd.path, externalBinPath); | ||
} | ||
function getExeExtension() { | ||
let cmdExtension; | ||
if (process.env.PATHEXT) { | ||
cmdExtension = process.env.PATHEXT | ||
.split(path_1.default.delimiter) | ||
.find(ext => ext.toUpperCase() === '.EXE'); | ||
} | ||
return cmdExtension ?? '.exe'; | ||
} | ||
async function safeReadPkgJson(pkgDir) { | ||
@@ -188,0 +205,0 @@ try { |
{ | ||
"name": "@pnpm/link-bins", | ||
"version": "7.2.7", | ||
"version": "7.2.8", | ||
"description": "Link bins to node_modules/.bin", | ||
@@ -26,10 +26,11 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@pnpm/error": "3.0.1", | ||
"@pnpm/manifest-utils": "3.1.4", | ||
"@pnpm/error": "3.1.0", | ||
"@pnpm/manifest-utils": "3.1.5", | ||
"@pnpm/package-bins": "6.0.8", | ||
"@pnpm/read-modules-dir": "4.0.0", | ||
"@pnpm/read-package-json": "6.0.10", | ||
"@pnpm/read-project-manifest": "3.0.11", | ||
"@pnpm/read-package-json": "6.0.11", | ||
"@pnpm/read-project-manifest": "3.0.12", | ||
"@pnpm/types": "8.7.0", | ||
"@zkochan/cmd-shim": "^5.3.1", | ||
"@zkochan/rimraf": "^2.1.2", | ||
"bin-links": "^3.0.3", | ||
@@ -44,3 +45,3 @@ "is-subdir": "^1.2.0", | ||
"devDependencies": { | ||
"@pnpm/link-bins": "7.2.7", | ||
"@pnpm/link-bins": "7.2.8", | ||
"@pnpm/test-fixtures": "0.0.23", | ||
@@ -47,0 +48,0 @@ "@types/is-windows": "^1.0.0", |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
20985
230
17
4
+ Added@zkochan/rimraf@^2.1.2
+ Added@pnpm/error@3.1.0(transitive)
+ Added@pnpm/manifest-utils@3.1.5(transitive)
+ Added@pnpm/read-package-json@6.0.11(transitive)
+ Added@pnpm/read-project-manifest@3.0.12(transitive)
- Removed@pnpm/error@3.0.1(transitive)
- Removed@pnpm/manifest-utils@3.1.4(transitive)
- Removed@pnpm/read-package-json@6.0.10(transitive)
- Removed@pnpm/read-project-manifest@3.0.11(transitive)
Updated@pnpm/error@3.1.0
Updated@pnpm/manifest-utils@3.1.5