File tree Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Original file line number Diff line number Diff line change 3737 },
3838 "devDependencies" : {
3939 "@commitlint/utils" : " ^13.2.0" ,
40- "@commitlint/types" : " ^13.2.0" ,
4140 "@commitlint/config-angular" : " ^13.2.0" ,
4241 "@types/inquirer" : " ^6.5.0" ,
4342 "commitizen" : " ^4.2.4"
4443 },
4544 "dependencies" : {
4645 "@commitlint/load" : " ^13.2.0" ,
46+ "@commitlint/types" : " ^13.2.0" ,
4747 "chalk" : " ^4.0.0" ,
4848 "lodash" : " ^4.17.19" ,
4949 "inquirer" : " ^6.5.2"
Original file line number Diff line number Diff line change @@ -3,16 +3,8 @@ import {input} from './input';
33
44type Commit = ( input : string ) => void ;
55
6- /**
7- * Entry point for commitizen
8- * @param cz inquirer instance passed by commitizen
9- * @param commit callback to execute with complete commit message
10- * @return {void }
11- */
12- export async function prompter (
13- cz : typeof inquirer ,
14- commit : Commit
15- ) : Promise < void > {
16- const message = await input ( cz . prompt ) ;
17- commit ( message ) ;
6+ export function prompter ( cz : typeof inquirer , commit : Commit ) : void {
7+ input ( cz . prompt ) . then ( ( message ) => {
8+ commit ( message ) ;
9+ } ) ;
1810}
Original file line number Diff line number Diff line change 11/// <reference path="./inquirer.d.ts" />
2- import { Interface as ReadlineInterface , Key } from 'readline' ;
3-
42import chalk from 'chalk' ;
53import inquirer from 'inquirer' ;
64import InputPrompt from 'inquirer/lib/prompts/input' ;
75import observe from 'inquirer/lib/utils/events' ;
6+ import { Interface as ReadlineInterface , Key } from 'readline' ;
87import type { Subscription } from 'rxjs/internal/Subscription' ;
98
109import Answers = inquirer . Answers ;
@@ -86,7 +85,6 @@ export default class InputCustomPrompt<
8685 render ( error ?: string ) : void {
8786 const answered = this . status === 'answered' ;
8887
89- let bottomContent = '' ;
9088 let message = this . getQuestion ( ) ;
9189 const length = this . measureInput ( this . rl . line ) ;
9290
@@ -96,6 +94,8 @@ export default class InputCustomPrompt<
9694 message += this . opt . transformer ( this . rl . line , this . answers , { } ) ;
9795 }
9896
97+ let bottomContent = '' ;
98+
9999 if ( error ) {
100100 bottomContent = chalk . red ( '>> ' ) + error ;
101101 } else if ( ! answered ) {
You can’t perform that action at this time.
0 commit comments