Skip to content

Commit c098626

Browse files
author
GitHub Action
committed
Release: 1.14.6
1 parent ca6dca7 commit c098626

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

js/lib/cli.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@ nopt.typeDefs.brace_style = {
6363
return true;
6464
}
6565
};
66+
nopt.typeDefs.glob = {
67+
type: "glob",
68+
validate: function(data, key, val) {
69+
if (typeof val === 'string' && glob.hasMagic(val)) {
70+
// Preserve value if it contains glob magic
71+
data[key] = val;
72+
return true;
73+
} else {
74+
// Otherwise validate it as regular path
75+
return nopt.typeDefs.path.validate(data, key, val);
76+
}
77+
}
78+
};
6679
var path = require('path'),
6780
editorconfig = require('editorconfig'),
6881
knownOpts = {
@@ -112,7 +125,7 @@ var path = require('path'),
112125
// CLI
113126
"version": Boolean,
114127
"help": Boolean,
115-
"files": [path, Array],
128+
"files": ["glob", Array],
116129
"outfile": path,
117130
"replace": Boolean,
118131
"quiet": Boolean,

0 commit comments

Comments
 (0)