diff --git a/src/util/path.js b/src/util/path.js index d0da7ce..bd418be 100644 --- a/src/util/path.js +++ b/src/util/path.js @@ -19,6 +19,10 @@ import path_ from "path-browserify"; export const resolveRelativePath = (vars, relativePath) => { + if (!relativePath) { + // If relativePath is undefined, return home directory + return vars.home; + } if ( relativePath.startsWith('/') ) { return relativePath; } @@ -26,4 +30,4 @@ export const resolveRelativePath = (vars, relativePath) => { return path_.resolve(vars.home, '.' + relativePath.slice(1)); } return path_.resolve(vars.pwd, relativePath); -}; \ No newline at end of file +};