Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const checkDataTypeCompatibility = (params) => {
return allowedParamsDataTypes.includes(typeof params)
}

const checkIfAbsolutePath = path => path.startsWith('/') || path.startsWith('~/');


module.exports = function openssl(params, callback = () => undefined) {
const stdout = [];
Expand Down Expand Up @@ -66,7 +68,7 @@ module.exports = function openssl(params, callback = () => undefined) {
parameters[i] = dir + parameters[i];
}

if (checkCommandForIO(parameters[i]) && typeof parameters[i + 1] !== 'object') {
if (checkCommandForIO(parameters[i]) && typeof parameters[i + 1] !== 'object' && !checkIfAbsolutePath(parameters[i +1])) {
parameters[i + 1] = dir + parameters[i + 1];
}
}
Expand Down