Fix: questionPath does not check "~"

This commit is contained in:
anseki 2015-04-24 20:00:33 +09:00
parent 0c9ee33072
commit 4097639ab7
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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) {