From eb954d0ffebe81f8cd12337f67f446be391a0df8 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 7 Jun 2020 14:18:00 +0200 Subject: [PATCH] run tower bin via composer as the composer bin directory may not be in the $PATH --- src/Gene/Listen.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Gene/Listen.php b/src/Gene/Listen.php index a4cb71d..79d1cd1 100644 --- a/src/Gene/Listen.php +++ b/src/Gene/Listen.php @@ -31,7 +31,11 @@ public function express( ): History { try { $preCondition = new Script( - Command::foreground('which')->withArgument('tower'), + Command::foreground('composer') + ->withArgument('global') + ->withArgument('exec') + ->withArgument('tower help') + ->withShortOption('v'), ); $preCondition($target); } catch (ScriptFailed $e) { @@ -40,10 +44,11 @@ public function express( try { $listen = new Script( - Command::foreground('tower') - ->withArgument('listen') - ->withArgument('1337') - ->withOption('daemon'), + Command::foreground('composer') + ->withArgument('global') + ->withArgument('exec') + ->withArgument('tower listen 1337 --daemon') + ->withShortOption('v'), ); $listen($target); } catch (ScriptFailed $e) {