diff --git a/README.md b/README.md index 429af30..195947b 100644 --- a/README.md +++ b/README.md @@ -800,6 +800,7 @@ console.log('-- saveDir: ' + saveDir); ```console Read from :~/fileA No such file or directory: /home/user/fileA +Input valid path, please. Read from :pwd /path/to/work Read from :cd ~/project-1 diff --git a/lib/readline-sync.js b/lib/readline-sync.js index 4e1de64..6604c2d 100644 --- a/lib/readline-sync.js +++ b/lib/readline-sync.js @@ -944,7 +944,7 @@ exports.questionPath = function(query, options) { keepWhitespace: false, limit: function(value) { var exists, stat, res; - value = replaceHomePath(value); + value = replaceHomePath(value, true); // mkdir -p function mkdirParents(dirPath) { dirPath.split(/\/|\\/).reduce(function(parents, dir) {