Skip to content

Commit 3592461

Browse files
committed
fix: if no entries in toc take input dir files
1 parent 98297ad commit 3592461

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/commands/translate/utils/config.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function resolveFiles(
9898
exclude: string[],
9999
lang: string | null,
100100
exts: string[],
101-
tocEntries?: string[],
101+
tocEntries: string[],
102102
) {
103103
let result: string[];
104104
let skipped: [string, string][] = [];
@@ -118,13 +118,14 @@ export function resolveFiles(
118118
return acc.concat(path);
119119
}, [] as string[]);
120120
} else {
121-
result = tocEntries
122-
? tocEntries
123-
: globSync(extmatch, {
124-
cwd: input,
125-
nodir: true,
126-
ignore: ['node_modules/**', '*/node_modules/**'],
127-
});
121+
result =
122+
tocEntries.length > 0
123+
? tocEntries
124+
: globSync(extmatch, {
125+
cwd: input,
126+
nodir: true,
127+
ignore: ['node_modules/**', '*/node_modules/**'],
128+
});
128129

129130
if (exclude.length) {
130131
[result, skipped] = skip(result, skipped, exclude, 'exclude');

0 commit comments

Comments
 (0)