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"
|
"description": "Custom git commit message to use when committing the changes made by this command"
|
||||||
},
|
},
|
||||||
"commitArgs": {
|
"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"
|
"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": {
|
"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."
|
"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": {
|
"tagArgs": {
|
||||||
"type": "string",
|
"type": ["string", "array"],
|
||||||
"description": "Additional arguments to pass to the `git tag` command invoked behind the scenes"
|
"description": "Additional arguments to pass to the `git tag` command invoked behind the scenes"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,10 +30,10 @@ interface GitCommitAndTagOptions {
|
|||||||
stageChanges?: boolean;
|
stageChanges?: boolean;
|
||||||
gitCommit?: boolean;
|
gitCommit?: boolean;
|
||||||
gitCommitMessage?: string;
|
gitCommitMessage?: string;
|
||||||
gitCommitArgs?: string;
|
gitCommitArgs?: string | string[];
|
||||||
gitTag?: boolean;
|
gitTag?: boolean;
|
||||||
gitTagMessage?: string;
|
gitTagMessage?: string;
|
||||||
gitTagArgs?: string;
|
gitTagArgs?: string | string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export type VersionOptions = NxReleaseArgs &
|
export type VersionOptions = NxReleaseArgs &
|
||||||
|
|||||||
@ -251,7 +251,7 @@ export async function gitCommit({
|
|||||||
logFn,
|
logFn,
|
||||||
}: {
|
}: {
|
||||||
messages: string[];
|
messages: string[];
|
||||||
additionalArgs?: string;
|
additionalArgs?: string | string[];
|
||||||
dryRun?: boolean;
|
dryRun?: boolean;
|
||||||
verbose?: boolean;
|
verbose?: boolean;
|
||||||
logFn?: (message: string) => void;
|
logFn?: (message: string) => void;
|
||||||
@ -263,7 +263,11 @@ export async function gitCommit({
|
|||||||
commandArgs.push('--message', message);
|
commandArgs.push('--message', message);
|
||||||
}
|
}
|
||||||
if (additionalArgs) {
|
if (additionalArgs) {
|
||||||
commandArgs.push(...additionalArgs.split(' '));
|
if (Array.isArray(additionalArgs)) {
|
||||||
|
commandArgs.push(...additionalArgs);
|
||||||
|
} else {
|
||||||
|
commandArgs.push(...additionalArgs.split(' '));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
@ -305,7 +309,7 @@ export async function gitTag({
|
|||||||
}: {
|
}: {
|
||||||
tag: string;
|
tag: string;
|
||||||
message?: string;
|
message?: string;
|
||||||
additionalArgs?: string;
|
additionalArgs?: string | string[];
|
||||||
dryRun?: boolean;
|
dryRun?: boolean;
|
||||||
verbose?: boolean;
|
verbose?: boolean;
|
||||||
logFn?: (message: string) => void;
|
logFn?: (message: string) => void;
|
||||||
@ -321,7 +325,11 @@ export async function gitTag({
|
|||||||
message || tag,
|
message || tag,
|
||||||
];
|
];
|
||||||
if (additionalArgs) {
|
if (additionalArgs) {
|
||||||
commandArgs.push(...additionalArgs.split(' '));
|
if (Array.isArray(additionalArgs)) {
|
||||||
|
commandArgs.push(...additionalArgs);
|
||||||
|
} else {
|
||||||
|
commandArgs.push(...additionalArgs.split(' '));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
|
|||||||
@ -88,7 +88,7 @@ export async function commitChanges({
|
|||||||
isDryRun?: boolean;
|
isDryRun?: boolean;
|
||||||
isVerbose?: boolean;
|
isVerbose?: boolean;
|
||||||
gitCommitMessages?: string[];
|
gitCommitMessages?: string[];
|
||||||
gitCommitArgs?: string;
|
gitCommitArgs?: string | string[];
|
||||||
}) {
|
}) {
|
||||||
if (!changedFiles?.length && !deletedFiles?.length) {
|
if (!changedFiles?.length && !deletedFiles?.length) {
|
||||||
throw new Error('Error: No changed files to commit');
|
throw new Error('Error: No changed files to commit');
|
||||||
|
|||||||
@ -123,9 +123,9 @@ export interface NxReleaseGitConfiguration {
|
|||||||
*/
|
*/
|
||||||
commitMessage?: string;
|
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.
|
* 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;
|
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 {
|
export interface NxReleaseConventionalCommitsConfiguration {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user