Skip to content

Commit 7ef426d

Browse files
committed
transpile
1 parent 3a83534 commit 7ef426d

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

transpile.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11

22
#
3+
# /bin/bash transpile.sh transpile.ignore
4+
# /bin/bash transpile.sh transpile.ignore --watch
35
# /bin/bash transpile.sh
46
# /bin/bash transpile.sh --watch
57
#
8+
# That script is responsible just for transpiling
9+
#
610

711
find . -type d \( \
812
-name node_modules \

transpile.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ const th = (msg: string) => new Error(`transpile.ts error: ${msg}`);
99

1010
const watch = process.argv.includes("--watch");
1111

12-
const ignoreFile = "transpile.ignore";
13-
if (!fs.existsSync(ignoreFile)) {
14-
throw th(`${ignoreFile} doesn't exist`);
12+
const ignoreFileArg = process.argv[2];
13+
14+
let ignore: any = { accepts: () => true };
15+
16+
if (ignoreFileArg) {
17+
if (!fs.existsSync(ignoreFileArg)) {
18+
throw th(`${ignoreFileArg} doesn't exist`);
19+
}
20+
ignore = gitignore.compile(fs.readFileSync(ignoreFileArg, "utf8"));
1521
}
16-
const ignore = gitignore.compile(fs.readFileSync(ignoreFile, "utf8"));
1722

1823
async function getEntryPointsFromStdin(): Promise<string[]> {
1924
const rl = readline.createInterface({

0 commit comments

Comments
 (0)