Comparing version 1.4.0 to 1.5.0
@@ -12,2 +12,6 @@ # Changelog | ||
## [1.5.0] - 2022-02-14 | ||
- Follow symbolic links when determining the shell to escape for. | ||
## [1.4.0] - 2022-02-08 | ||
@@ -14,0 +18,0 @@ |
@@ -11,3 +11,3 @@ /** | ||
* @module shescape | ||
* @version 1.4.0 | ||
* @version 1.5.0 | ||
* @license MPL-2.0 | ||
@@ -14,0 +14,0 @@ * @author Eric Cornelissen <ericornelissen@gmail.com> |
{ | ||
"name": "shescape", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "simple shell escape library", | ||
@@ -50,2 +50,5 @@ "homepage": "https://ericcornelissen.github.io/shescape/", | ||
], | ||
"dependencies": { | ||
"which": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
@@ -63,3 +66,4 @@ "@stryker-mutator/core": "5.6.1", | ||
"prettier": "2.5.1", | ||
"rollup": "2.67.1" | ||
"rollup": "2.67.2", | ||
"sinon": "13.0.1" | ||
}, | ||
@@ -66,0 +70,0 @@ "engines": { |
@@ -21,3 +21,3 @@ # Shescape | ||
- Zero dependencies | ||
- Advanced shell detection | ||
- Lightweight | ||
@@ -24,0 +24,0 @@ - Supports MacOS, Linux, and Windows |
@@ -8,3 +8,7 @@ /** | ||
import * as fs from "fs"; | ||
import which from "which"; | ||
import { typeError, win32 } from "./constants.js"; | ||
import { resolveExecutable } from "./executables.js"; | ||
import * as unix from "./unix.js"; | ||
@@ -36,12 +40,23 @@ import * as win from "./win.js"; | ||
function getShell(platform, env, shell) { | ||
if (shell !== undefined) { | ||
return shell; | ||
if (shell === undefined) { | ||
switch (platform) { | ||
case win32: | ||
shell = win.getDefaultShell(env); | ||
break; | ||
default: | ||
shell = unix.getDefaultShell(); | ||
break; | ||
} | ||
} | ||
switch (platform) { | ||
case win32: | ||
return win.getDefaultShell(env); | ||
default: | ||
return unix.getDefaultShell(); | ||
} | ||
return resolveExecutable( | ||
{ | ||
executable: shell, | ||
}, | ||
{ | ||
exists: fs.existsSync, | ||
readlink: fs.readlinkSync, | ||
which: which.sync, | ||
} | ||
); | ||
} | ||
@@ -48,0 +63,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62166
13
912
1
13
10
+ Addedwhich@^2.0.0
+ Addedisexe@2.0.0(transitive)
+ Addedwhich@2.0.2(transitive)