File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,9 @@ export async function execCommand(input) {
163163 // Handle help command
164164 const command = args [ 0 ] ;
165165 showHelp ( command ) ;
166- } else if ( cmd . startsWith ( '!' ) ) {
166+ return ;
167+ }
168+ if ( cmd . startsWith ( '!' ) ) {
167169 // Execute the command on the host machine
168170 const hostCommand = input . slice ( 1 ) ; // Remove the "!"
169171 exec ( hostCommand , ( error , stdout , stderr ) => {
@@ -178,17 +180,20 @@ export async function execCommand(input) {
178180 console . log ( stdout ) ;
179181 console . log ( chalk . green ( `Press <Enter> to return.` ) ) ;
180182 } ) ;
181- } else if ( commands [ cmd ] ) {
183+ return ;
184+ }
185+ if ( commands [ cmd ] ) {
182186 try {
183187 await commands [ cmd ] ( args ) ;
184188 } catch ( error ) {
185189 console . error ( chalk . red ( `Error executing command: ${ error . message } ` ) ) ;
186190 }
187- } else {
188- if ( ! [ 'Y' , 'N' ] . includes ( cmd . toUpperCase ( ) [ 0 ] ) ) {
189- console . log ( chalk . red ( `Unknown command: ${ cmd } ` ) ) ;
190- showHelp ( ) ;
191- }
191+ return ;
192+ }
193+
194+ if ( ! [ 'Y' , 'N' ] . includes ( cmd . toUpperCase ( ) [ 0 ] ) ) {
195+ console . log ( chalk . red ( `Unknown command: ${ cmd } ` ) ) ;
196+ showHelp ( ) ;
192197 }
193198}
194199
You can’t perform that action at this time.
0 commit comments