diff --git a/lib/cli.ts b/lib/cli.ts index 6a95779..2cd2569 100644 --- a/lib/cli.ts +++ b/lib/cli.ts @@ -9,7 +9,7 @@ import * as ts from "typescript"; import * as fs from "fs"; import * as path from "path"; import * as commandpost from "commandpost"; - +import * as glob from "glob"; import * as lib from "./"; import { getConfigFileName, readFilesFromTsconfig } from "./utils"; @@ -94,6 +94,14 @@ let root = commandpost process.stdout.write(root.helpText() + "\n"); return; } + let matchedFiles = new Array(); + files.forEach((pattern) => { + const matched = glob.sync(pattern); + if (matched && matched.length > 0) { + matchedFiles = matchedFiles.concat(matched); + } + }); + files = matchedFiles; if (verbose) { const printPool: { [name: string]: string; } = {}; diff --git a/package.json b/package.json index 08d1681..54e838d 100644 --- a/package.json +++ b/package.json @@ -33,12 +33,14 @@ }, "dependencies": { "commandpost": "^1.0.0", - "editorconfig": "^0.15.0" + "editorconfig": "^0.15.0", + "glob": "^7.1.2" }, "peerDependencies": { "typescript": "^2.1.6 || ^3.0.0 || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev" }, "devDependencies": { + "@types/glob": "^5.0.35", "@types/mkdirp": "^0.5.0", "@types/mocha": "^5.0.0", "@types/node": "^10.3.0",