process glob matching in babel-cli (windows compat)

This commit is contained in:
jden 2015-04-30 10:57:48 -07:00
parent 98206df864
commit 479c3e477a
2 changed files with 11 additions and 7 deletions

View File

@ -8,6 +8,7 @@ var util = require("babel-core").util;
var each = require("lodash/collection/each");
var keys = require("lodash/object/keys");
var fs = require("fs");
var glob = require('glob');
each(options, function (option, key) {
if (option.hidden) return;
@ -69,7 +70,9 @@ commander.parse(process.argv);
var errors = [];
var filenames = commander.args;
var filenames = commander.args.reduce(function (globbed, input) {
return globbed.concat(glob.sync(input));
}, []);
each(filenames, function (filename) {
if (!fs.existsSync(filename)) {

View File

@ -10,16 +10,17 @@
"babel-core": "^5.1.13",
"chokidar": "^1.0.0",
"commander": "^2.6.0",
"fs-readdir-recursive": "^0.1.0",
"output-file-sync": "^1.1.0",
"lodash": "^3.2.0",
"convert-source-map": "^1.1.0",
"source-map": "^0.4.0",
"path-is-absolute": "^1.0.0"
"fs-readdir-recursive": "^0.1.0",
"glob": "^5.0.5",
"lodash": "^3.2.0",
"output-file-sync": "^1.1.0",
"path-is-absolute": "^1.0.0",
"source-map": "^0.4.0"
},
"bin": {
"babel": "./bin/babel/index.js",
"babel-node": "./bin/babel-node",
"babel-external-helpers": "./bin/babel-external-helpers"
}
}
}