@@ -403,26 +403,25 @@ function (ConsoleCommandEvent $event) {
403
403
/**
404
404
* Echo or set the name of the currently-selected share tool (either "ngrok" or "expose").
405
405
*/
406
- $ share_tools_list = preg_replace ('/,\s([^,]+)$/ ' , ' or $1 ' ,
407
- join (', ' , array_map (fn ($ t ) => "` $ t` " , $ share_tools )));
408
-
409
406
$ app ->command ('share-tool [tool] ' , function (InputInterface $ input , OutputInterface $ output , $ tool = null )
410
- use ($ share_tools, $ share_tools_list ) {
407
+ use ($ share_tools ) {
411
408
if ($ tool === null ) {
412
409
return output (Configuration::read ()['share-tool ' ] ?? '(not set) ' );
413
410
}
414
411
415
- if (! in_array ($ tool , $ share_tools ) || ! class_exists (ucfirst ($ tool ))) {
416
- warning ($ tool .' is not a valid share tool. Please use ' .$ share_tools_list .'. ' );
412
+ $ share_tools_list = preg_replace ('/,\s([^,]+)$/ ' , ' or $1 ' ,
413
+ join (', ' , array_map (fn ($ t ) => "` $ t` " , $ share_tools )));
414
+
415
+ if (! in_array ($ tool , $ share_tools ) || ! class_exists ($ tool )) {
416
+ warning ("$ tool is not a valid share tool. Please use $ share_tools_list. " );
417
417
418
418
return Command::FAILURE ;
419
419
}
420
420
421
421
Configuration::updateKey ('share-tool ' , $ tool );
422
- info ('Share tool set to ' .$ tool .'. ' );
423
- $ share_tool = ucfirst ($ tool );
422
+ info ("Share tool set to $ tool. " );
424
423
425
- if (! $ share_tool ::installed ()) {
424
+ if (! $ tool ::installed ()) {
426
425
$ helper = $ this ->getHelperSet ()->get ('question ' );
427
426
$ question = new ConfirmationQuestion (
428
427
'Would you like to install ' .ucfirst ($ tool ).' now? [y/N] ' ,
@@ -434,9 +433,11 @@ function (ConsoleCommandEvent $event) {
434
433
return ;
435
434
}
436
435
437
- $ share_tool ::ensureInstalled ();
436
+ $ tool ::ensureInstalled ();
438
437
}
439
- })->descriptions ('Get the name of the current share tool ( ' .$ share_tools_list .'). ' );
438
+
439
+ return Command::SUCCESS ;
440
+ })->descriptions ('Get the name of the current share tool. ' );
440
441
441
442
/**
442
443
* Set the ngrok auth token.
0 commit comments