Skip to content

Commit

Permalink
feat(npm): add possibility for skipCommit to take an array of values
Browse files Browse the repository at this point in the history
  • Loading branch information
favna authored and orhun committed Sep 21, 2024
1 parent c77420c commit a6e3b78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion npm/git-cliff/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type Options = Partial<{
includePath: string;
excludePath: string;
withCommit: string;
skipCommit: string;
skipCommit: string | string[];
prepend: string;
output: string;
tag: string;
Expand Down
6 changes: 5 additions & 1 deletion npm/git-cliff/src/optionsToStringArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ export function optionsToStringArgs(options: Options): string[] {
for (const [key, value] of Object.entries(options)) {
const hyphenCaseKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();

if (value === true) {
if (Array.isArray(value)) {
for (const arrValue of value) {
args.push(`--${hyphenCaseKey}`, arrValue);
}
} else if (value === true) {
args.push(`--${hyphenCaseKey}`);
} else if (value === false || value === null) {
continue;
Expand Down

0 comments on commit a6e3b78

Please sign in to comment.