fix(release): allow string array for commitArgs and tagArgs (#27797)
This commit is contained in:
parent
0a8202aee1
commit
786537efa8
@ -634,7 +634,7 @@
|
||||
"description": "Custom git commit message to use when committing the changes made by this command"
|
||||
},
|
||||
"commitArgs": {
|
||||
"type": "string",
|
||||
"type": ["string", "array"],
|
||||
"description": "Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes"
|
||||
},
|
||||
"stageChanges": {
|
||||
@ -650,7 +650,7 @@
|
||||
"description": "Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself."
|
||||
},
|
||||
"tagArgs": {
|
||||
"type": "string",
|
||||
"type": ["string", "array"],
|
||||
"description": "Additional arguments to pass to the `git tag` command invoked behind the scenes"
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,10 +30,10 @@ interface GitCommitAndTagOptions {
|
||||
stageChanges?: boolean;
|
||||
gitCommit?: boolean;
|
||||
gitCommitMessage?: string;
|
||||
gitCommitArgs?: string;
|
||||
gitCommitArgs?: string | string[];
|
||||
gitTag?: boolean;
|
||||
gitTagMessage?: string;
|
||||
gitTagArgs?: string;
|
||||
gitTagArgs?: string | string[];
|
||||
}
|
||||
|
||||
export type VersionOptions = NxReleaseArgs &
|
||||
|
||||
@ -251,7 +251,7 @@ export async function gitCommit({
|
||||
logFn,
|
||||
}: {
|
||||
messages: string[];
|
||||
additionalArgs?: string;
|
||||
additionalArgs?: string | string[];
|
||||
dryRun?: boolean;
|
||||
verbose?: boolean;
|
||||
logFn?: (message: string) => void;
|
||||
@ -263,8 +263,12 @@ export async function gitCommit({
|
||||
commandArgs.push('--message', message);
|
||||
}
|
||||
if (additionalArgs) {
|
||||
if (Array.isArray(additionalArgs)) {
|
||||
commandArgs.push(...additionalArgs);
|
||||
} else {
|
||||
commandArgs.push(...additionalArgs.split(' '));
|
||||
}
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
logFn(
|
||||
@ -305,7 +309,7 @@ export async function gitTag({
|
||||
}: {
|
||||
tag: string;
|
||||
message?: string;
|
||||
additionalArgs?: string;
|
||||
additionalArgs?: string | string[];
|
||||
dryRun?: boolean;
|
||||
verbose?: boolean;
|
||||
logFn?: (message: string) => void;
|
||||
@ -321,8 +325,12 @@ export async function gitTag({
|
||||
message || tag,
|
||||
];
|
||||
if (additionalArgs) {
|
||||
if (Array.isArray(additionalArgs)) {
|
||||
commandArgs.push(...additionalArgs);
|
||||
} else {
|
||||
commandArgs.push(...additionalArgs.split(' '));
|
||||
}
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
logFn(
|
||||
|
||||
@ -88,7 +88,7 @@ export async function commitChanges({
|
||||
isDryRun?: boolean;
|
||||
isVerbose?: boolean;
|
||||
gitCommitMessages?: string[];
|
||||
gitCommitArgs?: string;
|
||||
gitCommitArgs?: string | string[];
|
||||
}) {
|
||||
if (!changedFiles?.length && !deletedFiles?.length) {
|
||||
throw new Error('Error: No changed files to commit');
|
||||
|
||||
@ -123,9 +123,9 @@ export interface NxReleaseGitConfiguration {
|
||||
*/
|
||||
commitMessage?: string;
|
||||
/**
|
||||
* Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes
|
||||
* Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes. May be a string or array of strings.
|
||||
*/
|
||||
commitArgs?: string;
|
||||
commitArgs?: string | string[];
|
||||
/**
|
||||
* Whether or not to stage the changes made by this command. Always treated as true if commit is true.
|
||||
*/
|
||||
@ -139,9 +139,9 @@ export interface NxReleaseGitConfiguration {
|
||||
*/
|
||||
tagMessage?: string;
|
||||
/**
|
||||
* Additional arguments to pass to the `git tag` command invoked behind the scenes
|
||||
* Additional arguments to pass to the `git tag` command invoked behind the scenes. . May be a string or array of strings.
|
||||
*/
|
||||
tagArgs?: string;
|
||||
tagArgs?: string | string[];
|
||||
}
|
||||
|
||||
export interface NxReleaseConventionalCommitsConfiguration {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user