feat(config): add auto-signing options

This commit is contained in:
2023-12-16 14:37:47 +02:00
parent 498c830e34
commit c80d763259
4 changed files with 14 additions and 7 deletions

View File

@@ -34,6 +34,8 @@ You can create an `.rczrc`, `.rczrc.json` or `rcz.config.json` file in your root
"value": "chore",
"hint": "a routine action"
}
]
],
"autoSignCommits": false,
"autoSignReleases": true
}
```

View File

@@ -1,6 +1,6 @@
{
"name": "@resultium/rcz",
"version": "1.6.0",
"version": "1.7.0",
"description": "Resultium commit standardization library, based on conventional commits",
"main": "./dist/index.js",
"bin": {

View File

@@ -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(
(

View File

@@ -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 {