Skip to content

Commit

Permalink
Merge pull request #2094 from HitkoDev/fix-windows-glob-issue
Browse files Browse the repository at this point in the history
Fix Windows glob issue
  • Loading branch information
bitwiseman committed Aug 21, 2022
2 parents 5d3ef45 + 86cde3e commit b1ccd70
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,4 +1,4 @@
PROJECT_ROOT=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
PROJECT_ROOT=$(subst \,/,$(dir $(realpath $(firstword $(MAKEFILE_LIST)))))
BUILD_DIR=$(PROJECT_ROOT)build
SCRIPT_DIR=$(PROJECT_ROOT)tools
SHELL=/bin/bash
Expand Down
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 b1ccd70

Please sign in to comment.