Skip to content

Commit

Permalink
Fix glob issue on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
HitkoDev committed Aug 19, 2022
1 parent 218252e commit 86cde3e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion js/src/cli.js
Expand Up @@ -63,6 +63,19 @@ nopt.typeDefs.brace_style = {
return true;
}
};
nopt.typeDefs.glob = {
type: "glob",
validate: function(data, key, val) {
if (typeof val === 'string' && glob.hasMagic(val)) {
// Preserve value if it contains glob magic
data[key] = val;
return true;
} else {
// Otherwise validate it as regular path
return nopt.typeDefs.path.validate(data, key, val);
}
}
};
var path = require('path'),
editorconfig = require('editorconfig'),
knownOpts = {
Expand Down Expand Up @@ -112,7 +125,7 @@ var path = require('path'),
// CLI
"version": Boolean,
"help": Boolean,
"files": [path, Array],
"files": ["glob", Array],
"outfile": path,
"replace": Boolean,
"quiet": Boolean,
Expand Down

0 comments on commit 86cde3e

Please sign in to comment.