Skip to content

Commit cd7b1b4

Browse files
authored
Allow the setting of an absolute path for IO
1 parent cdd5e8d commit cd7b1b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const checkDataTypeCompatibility = (params) => {
2222
return allowedParamsDataTypes.includes(typeof params)
2323
}
2424

25+
const checkIfAbsolutePath = path => path.startsWith('/') || path.startsWith('~/');
26+
2527

2628
module.exports = function openssl(params, callback = () => undefined) {
2729
const stdout = [];
@@ -66,7 +68,7 @@ module.exports = function openssl(params, callback = () => undefined) {
6668
parameters[i] = dir + parameters[i];
6769
}
6870

69-
if (checkCommandForIO(parameters[i]) && typeof parameters[i + 1] !== 'object') {
71+
if (checkCommandForIO(parameters[i]) && typeof parameters[i + 1] !== 'object' && !checkIfAbsolutePath(parameters[i +1])) {
7072
parameters[i + 1] = dir + parameters[i + 1];
7173
}
7274
}

0 commit comments

Comments
 (0)