From 479c3e477ab7e344a8d6fee589805724d909eb67 Mon Sep 17 00:00:00 2001 From: jden Date: Thu, 30 Apr 2015 10:57:48 -0700 Subject: [PATCH] process glob matching in babel-cli (windows compat) --- packages/babel-cli/bin/babel/index.js | 5 ++++- packages/babel-cli/package.json | 13 +++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/babel-cli/bin/babel/index.js b/packages/babel-cli/bin/babel/index.js index 48b214d0a8..24620d7ee6 100755 --- a/packages/babel-cli/bin/babel/index.js +++ b/packages/babel-cli/bin/babel/index.js @@ -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)) { diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index ba099f5d1a..5be752d38c 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -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" } -} \ No newline at end of file +}