Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 77dfc9a73b | |||
| 8ab631549a | |||
| 2670f79e2f | |||
| 3afc2ed071 | |||
| 45458d14e2 | |||
| d61c9ecf2e |
@@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
Generation of this changelog is based on commits
|
Generation of this changelog is based on commits
|
||||||
|
|
||||||
|
## v1.3.0
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- [755da3bb5] - **commands**: add ability to write a footer
|
||||||
|
- [9311be80b] - **commands**: add commit message validation command (#4)
|
||||||
|
|
||||||
## v1.2.0
|
## v1.2.0
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@resultium/rcz",
|
"name": "@resultium/rcz",
|
||||||
"version": "1.3.0",
|
"version": "1.4.0",
|
||||||
"description": "Resultium commit standardization library, based on conventional commits",
|
"description": "Resultium commit standardization library, based on conventional commits",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
20
src/index.ts
20
src/index.ts
@@ -33,7 +33,7 @@ const program = new Command();
|
|||||||
program
|
program
|
||||||
.name("rcz")
|
.name("rcz")
|
||||||
.description("Resultium commit standardization command-line interface")
|
.description("Resultium commit standardization command-line interface")
|
||||||
.version("1.3.0");
|
.version("1.4.0");
|
||||||
|
|
||||||
program
|
program
|
||||||
.command("commit")
|
.command("commit")
|
||||||
@@ -420,9 +420,11 @@ program
|
|||||||
.command("validate")
|
.command("validate")
|
||||||
.description("Validate whether a string fits given commit conventions")
|
.description("Validate whether a string fits given commit conventions")
|
||||||
.argument("[message]", "string for validation")
|
.argument("[message]", "string for validation")
|
||||||
.action(async (string: string) => {
|
.option("-C, --code-only", "return code only")
|
||||||
|
.action(async (string: string, options) => {
|
||||||
try {
|
try {
|
||||||
const message = string || fs.readFileSync(0, "utf-8");
|
const message = string || fs.readFileSync(0, "utf-8");
|
||||||
|
const codeOnly = options.codeOnly ? true : false;
|
||||||
|
|
||||||
const config = await GetConfig();
|
const config = await GetConfig();
|
||||||
|
|
||||||
@@ -439,11 +441,15 @@ program
|
|||||||
"gm"
|
"gm"
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(
|
if (codeOnly) {
|
||||||
testRegex.test(message)
|
console.log(testRegex.test(message) ? 0 : 1);
|
||||||
? "[rcz]: valid message"
|
} else {
|
||||||
: "[rcz]: invalid message"
|
console.log(
|
||||||
);
|
testRegex.test(message)
|
||||||
|
? "[rcz]: valid message"
|
||||||
|
: "[rcz]: invalid message"
|
||||||
|
);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("[rcz]: no stdin found");
|
console.log("[rcz]: no stdin found");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user