Skip to content

Commit 11deb34

Browse files
TehShrikelukeed
andauthored
fix: only glob TS and JS files (#31)
* Only glob up .(c|m)?js files I want to put a .sql file into my migrations directory :-x * money * whoops * Apply suggestions from code review Co-authored-by: Luke Edwards <[email protected]>
1 parent 498186a commit 11deb34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/util.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ const { resolve } = require('path');
44

55
exports.glob = async function (dir) {
66
const output = [];
7-
await totalist(dir, (name, abs) => output.push({ name, abs }));
7+
const rgx = /\.[cm]?[tj]s$/;
8+
await totalist(dir, (name, abs) => rgx.test(name) && output.push({ name, abs }));
89
return output.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric:true })); // ~rand order
910
}
1011

0 commit comments

Comments
 (0)