Skip to content

Commit

Permalink
feat: add exclude option
Browse files Browse the repository at this point in the history
  • Loading branch information
hbofolts1 committed Aug 30, 2023
1 parent 28cfed1 commit c8668f1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const plantuml = require("node-plantuml");
commander
.version(pjson.version)
.option('-i, --input <path>', 'Define the path of the Typescript file')
.option('-e, --exclude <path>', 'File(s) to ignore')
.option('-o, --output <path>', 'Define the path of the output file. If not defined, it\'ll output on the STDOUT')
.option(
'-p, --project <path>',
Expand All @@ -37,7 +38,13 @@ if (!commander.input) {
process.exit(1);
}

G(<string>commander.input, {}, (err: Error | null, matches: string[]): void => {
const globOptions: G.IOptions = {};

if (commander.exclude !== undefined) {
globOptions.ignore = <string>commander.exclude;
}

G(<string>commander.input, globOptions, (err: Error | null, matches: string[]): void => {
if (err !== null) {
throw err;
}
Expand Down

0 comments on commit c8668f1

Please sign in to comment.