Skip to content

Commit

Permalink
feat(tsfmt): add support for filesGlob
Browse files Browse the repository at this point in the history
  • Loading branch information
vvakame committed Oct 14, 2015
2 parents d618ee8 + d748dc5 commit bf9f704
Show file tree
Hide file tree
Showing 5 changed files with 410 additions and 177 deletions.
3 changes: 3 additions & 0 deletions dtsm.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
},
"power-assert/power-assert.d.ts": {
"ref": "09e37435ffb2c56a6f908081194a74756f24f99d"
},
"glob-expand/glob-expand.d.ts": {
"ref": "eab2e0487e9685952db58e487d484a1c342ec670"
}
}
}
6 changes: 5 additions & 1 deletion lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import * as fs from "fs";
import * as commandpost from "commandpost";
import * as path from "path";

import * as expand from "glob-expand";

import * as lib from "./";
import {getConfigFileName} from "./utils";

Expand Down Expand Up @@ -166,7 +168,9 @@ function readFilesFromTsconfig(configPath: string) {
if (tsconfig.files) {
let files: string[] = tsconfig.files;
return files.map(filePath => path.resolve(tsconfigDir, filePath));
} else if (tsconfig.filesGlob) {
return expand({ filter: "isFile", cwd: tsconfigDir }, tsconfig.filesGlob);
} else {
throw new Error(`No "files" section present in tsconfig.json`);
throw new Error(`No "files" or "filesGlob" section present in tsconfig.json`);
}
}
Loading

0 comments on commit bf9f704

Please sign in to comment.