Fix: questionPath
does not check "~"
This commit is contained in:
parent
0c9ee33072
commit
4097639ab7
2 changed files with 2 additions and 1 deletions
|
@ -800,6 +800,7 @@ console.log('-- saveDir: ' + saveDir);
|
||||||
```console
|
```console
|
||||||
Read from :~/fileA
|
Read from :~/fileA
|
||||||
No such file or directory: /home/user/fileA
|
No such file or directory: /home/user/fileA
|
||||||
|
Input valid path, please.
|
||||||
Read from :pwd
|
Read from :pwd
|
||||||
/path/to/work
|
/path/to/work
|
||||||
Read from :cd ~/project-1
|
Read from :cd ~/project-1
|
||||||
|
|
|
@ -944,7 +944,7 @@ exports.questionPath = function(query, options) {
|
||||||
keepWhitespace: false,
|
keepWhitespace: false,
|
||||||
limit: function(value) {
|
limit: function(value) {
|
||||||
var exists, stat, res;
|
var exists, stat, res;
|
||||||
value = replaceHomePath(value);
|
value = replaceHomePath(value, true);
|
||||||
// mkdir -p
|
// mkdir -p
|
||||||
function mkdirParents(dirPath) {
|
function mkdirParents(dirPath) {
|
||||||
dirPath.split(/\/|\\/).reduce(function(parents, dir) {
|
dirPath.split(/\/|\\/).reduce(function(parents, dir) {
|
||||||
|
|
Loading…
Reference in a new issue