File tree 3 files changed +5
-10
lines changed
3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,7 @@ class ExternalCommand extends Command {
10
10
}
11
11
12
12
async execute ( args ) {
13
- try {
14
- await this . executeCommand ( this . commandPath , args ) ;
15
- conso
16
- } catch ( error ) {
17
- }
13
+ await this . executeCommand ( this . commandPath , args ) ;
18
14
return { shouldContinue : true } ;
19
15
}
20
16
Original file line number Diff line number Diff line change @@ -4,11 +4,8 @@ class InputHandler {
4
4
this . inputBuffer = '' ;
5
5
}
6
6
7
- async getInput ( prompt ) {
7
+ async getInput ( ) {
8
8
return new Promise ( ( resolve ) => {
9
- this . readline . setPrompt ( prompt ) ;
10
- this . readline . prompt ( ) ;
11
-
12
9
const onKeypress = ( char , key ) => {
13
10
if ( key . name === 'return' || key . name === 'enter' ) {
14
11
this . readline . input . removeListener ( 'keypress' , onKeypress ) ;
Original file line number Diff line number Diff line change @@ -201,7 +201,9 @@ class Shell {
201
201
let shouldContinue = true ;
202
202
203
203
while ( shouldContinue ) {
204
- const input = await this . inputHandler . getInput ( "$ " ) ;
204
+ this . inputHandler . readline . setPrompt ( "$ " ) ;
205
+ this . readline . prompt ( ) ;
206
+ const input = await this . inputHandler . getInput ( ) ;
205
207
206
208
if ( input . trim ( ) === '' ) {
207
209
console . log ( "Empty command, please try again." ) ;
You can’t perform that action at this time.
0 commit comments