Skip to content

Commit

Permalink
fix: not working excludes option.
Browse files Browse the repository at this point in the history
  • Loading branch information
ytetsuro committed May 16, 2022
1 parent 84945f2 commit 89d77e9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ const generateCommand = () => {
.choices(['HTML', 'JSON', 'CSV'])
.default('HTML')
)
.requiredOption(
'--excludes <patterns...>',
'exclude patterns is separated by a comma. example: .test.ts$,.spec.ts$',
'$^'
)
.option('--excludes <patterns...>', 'exclude patterns is separated by a comma. example: .test.ts$ .spec.ts$')
.requiredOption('--matches <pattern>', 'match patterns. example: .ts$', '.*')
.option(
'-o, --outputReportPath <path>',
Expand All @@ -32,7 +28,7 @@ Fo r HTML or CSV, specify the directory, and for JSON, specify the file.`
const outputReportPath = options.outputReportPath ?? (options.outputFormat === 'JSON' ? null : './sabik_report');
const outputPath = outputReportPath !== null ? resolve(outputReportPath) : null;
const analyzedTarget = resolve(targetPath ?? './');
const excludes = (<string>options.excludes).split(',').map((row) => new RegExp(row));
const excludes = (<string[]>options.excludes ?? ['$^']).map((row) => new RegExp(row));
const matches = new RegExp(options.matches);

if (!fs.existsSync(analyzedTarget)) {
Expand Down

0 comments on commit 89d77e9

Please sign in to comment.