Comparing version 0.1.0 to 0.1.1
import execa from 'execa'; | ||
export declare function sync(file: string, args?: readonly string[], options?: execa.SyncOptions): execa.ExecaSyncReturnValue; | ||
export default function (file: string, args?: readonly string[], options?: execa.Options): Promise<execa.ExecaReturnValue<string>>; | ||
export default function (file: string, args?: readonly string[], options?: execa.Options): execa.ExecaChildProcess<string>; |
@@ -32,23 +32,7 @@ "use strict"; | ||
} | ||
async function default_1(file, args, options) { | ||
const fileAbsolutePath = await getCommandAbsolutePath(file, options); | ||
function default_1(file, args, options) { | ||
const fileAbsolutePath = getCommandAbsolutePathSync(file, options); | ||
return execa_1.default(fileAbsolutePath, args, options); | ||
} | ||
exports.default = default_1; | ||
async function getCommandAbsolutePath(file, options) { | ||
var _a, _b; | ||
if (file.includes('\\') || file.includes('/')) | ||
return file; | ||
const path = (_b = (_a = options === null || options === void 0 ? void 0 : options.env) === null || _a === void 0 ? void 0 : _a[path_name_1.default]) !== null && _b !== void 0 ? _b : process.env[path_name_1.default]; | ||
const key = JSON.stringify([path, file]); | ||
let fileAbsolutePath = pathCache.get(key); | ||
if (fileAbsolutePath == null) { | ||
fileAbsolutePath = await which_1.default(file, { path }); | ||
pathCache.set(key, fileAbsolutePath); | ||
} | ||
if (fileAbsolutePath == null) { | ||
throw new Error(`Couldn't find ${file}`); | ||
} | ||
return fileAbsolutePath; | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "safe-execa", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Like execa but prevents binary planting attacks on Windows", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
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
2
5127
39