File tree 2 files changed +7
-15
lines changed
2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,8 @@ import {input} from './input';
3
3
4
4
type Commit = ( input : string ) => void ;
5
5
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
+ } ) ;
18
10
}
Original file line number Diff line number Diff line change 1
1
/// <reference path="./inquirer.d.ts" />
2
- import { Interface as ReadlineInterface , Key } from 'readline' ;
3
-
4
2
import chalk from 'chalk' ;
5
3
import inquirer from 'inquirer' ;
6
4
import InputPrompt from 'inquirer/lib/prompts/input' ;
7
5
import observe from 'inquirer/lib/utils/events' ;
6
+ import { Interface as ReadlineInterface , Key } from 'readline' ;
8
7
import type { Subscription } from 'rxjs/internal/Subscription' ;
9
8
10
9
import Answers = inquirer . Answers ;
@@ -86,7 +85,6 @@ export default class InputCustomPrompt<
86
85
render ( error ?: string ) : void {
87
86
const answered = this . status === 'answered' ;
88
87
89
- let bottomContent = '' ;
90
88
let message = this . getQuestion ( ) ;
91
89
const length = this . measureInput ( this . rl . line ) ;
92
90
@@ -96,6 +94,8 @@ export default class InputCustomPrompt<
96
94
message += this . opt . transformer ( this . rl . line , this . answers , { } ) ;
97
95
}
98
96
97
+ let bottomContent = '' ;
98
+
99
99
if ( error ) {
100
100
bottomContent = chalk . red ( '>> ' ) + error ;
101
101
} else if ( ! answered ) {
You can’t perform that action at this time.
0 commit comments