Skip to content

Commit b6f3b32

Browse files
authored
Merge pull request #41 from neogeek/hotfix/fixed-ignorefile
[hotfix] Fixed issue with ignorefile not working.
2 parents 929813c + 4941ce6 commit b6f3b32

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bin/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import 'tsx/esm';
44

5-
import { glob } from 'node:fs/promises';
5+
import { glob, readFile } from 'node:fs/promises';
6+
import { existsSync } from 'node:fs';
67
import { parseArgs } from 'node:util';
78

89
import chalk from 'chalk';
@@ -51,6 +52,10 @@ const [ignoreFile = '.onlyignore'] = [args.values.ignore]
5152
.filter(Boolean)
5253
.map(String);
5354

55+
const filesToIgnore = existsSync(ignoreFile)
56+
? (await readFile(ignoreFile, 'utf8')).split(/\n+/g).filter(Boolean)
57+
: [];
58+
5459
const filesToBuild = (
5560
await Array.fromAsync(
5661
glob(['**/*.mjs', '**/*.jsx', '**/*.ts', '**/*.tsx'].filter(Boolean), {
@@ -73,7 +78,8 @@ const filesToCopy = (
7378
'package-lock.json',
7479
'node_modules/',
7580
buildDir,
76-
ignoreFile
81+
ignoreFile,
82+
...filesToIgnore
7783
],
7884
cwd: args.positionals[0]
7985
})

0 commit comments

Comments
 (0)