feat(config): add auto-signing options
This commit is contained in:
13
src/index.ts
13
src/index.ts
@@ -45,7 +45,7 @@ const program = new Command();
|
||||
program
|
||||
.name("rcz")
|
||||
.description("Resultium commit standardization command-line interface")
|
||||
.version("1.6.0");
|
||||
.version("1.7.0");
|
||||
|
||||
program
|
||||
.command("commit")
|
||||
@@ -53,11 +53,11 @@ program
|
||||
.option("-S, --sign", "sign the commit")
|
||||
.option("--amend", "amend commit message to the last commit")
|
||||
.action(async (options) => {
|
||||
const sign = options.sign ? true : false;
|
||||
const amend = options.amend ? true : false;
|
||||
|
||||
const config = await GetConfig();
|
||||
|
||||
const sign = config?.autoSignCommits || options.sign ? true : false;
|
||||
const amend = options.amend ? true : false;
|
||||
|
||||
intro("Creating a conventional commit");
|
||||
|
||||
if (!fs.existsSync(path.join(process.cwd(), ".git"))) {
|
||||
@@ -421,7 +421,10 @@ program
|
||||
.argument("<version>", "new version formatted in SemVer")
|
||||
.option("-S, --sign", "sign the release commit and tag")
|
||||
.action(async (string: string, options) => {
|
||||
const sign = options.sign ? true : false;
|
||||
const config = await GetConfig();
|
||||
|
||||
const sign = config?.autoSignReleases || options.sign ? true : false;
|
||||
|
||||
const version = string.replace("v", "");
|
||||
const packageFile = JSON.parse(
|
||||
(
|
||||
|
||||
@@ -3,6 +3,8 @@ import { DefaultLogFields, ListLogLine } from "simple-git";
|
||||
export interface Config {
|
||||
types?: Array<Type>;
|
||||
scopes?: Array<string>;
|
||||
autoSignCommits?: boolean;
|
||||
autoSignReleases?: boolean;
|
||||
}
|
||||
|
||||
export interface Type {
|
||||
|
||||
Reference in New Issue
Block a user