From e45bd007d44b233b8e6398f478e2de7856c65ded Mon Sep 17 00:00:00 2001 From: Simon Dann Date: Wed, 20 Dec 2017 14:29:25 +0000 Subject: [PATCH 1/3] :memo: adding changelog for #272 --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 369ecb6..c5ae2b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,11 @@ Tapestry currently operates a one month release cycle between releases, see the ## [1.0.12] - Unreleased +### Fixed +- #272 Disable self-update command if not executed within a phar + ### Added -- #157 Added lock file support so Tapestry doesn't run concurrently. +- #157 Added lock file support so Tapestry doesn't run concurrently ## [1.0.11] - 2017-11-23 From 3005d99670c443547688bfa4a7c51f3d1c8c158b Mon Sep 17 00:00:00 2001 From: Simon Dann Date: Wed, 20 Dec 2017 14:39:49 +0000 Subject: [PATCH 2/3] :sparkles: completed functionality for #272 --- src/Providers/CommandServiceProvider.php | 29 +++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/Providers/CommandServiceProvider.php b/src/Providers/CommandServiceProvider.php index 7fefec0..de497f3 100644 --- a/src/Providers/CommandServiceProvider.php +++ b/src/Providers/CommandServiceProvider.php @@ -26,10 +26,13 @@ class CommandServiceProvider extends AbstractServiceProvider * from the ContainerAwareTrait. * * @return void + * @throws \Psr\Container\ContainerExceptionInterface + * @throws \Psr\Container\NotFoundExceptionInterface */ public function register() { $container = $this->getContainer(); + $commands = []; $container->add(InitCommand::class) ->withArguments([ @@ -37,17 +40,24 @@ public function register() \Symfony\Component\Finder\Finder::class, ]); + array_push($commands, $container->get(InitCommand::class)); + $this->getContainer()->add(BuildCommand::class) ->withArguments([ Tapestry::class, $this->getContainer()->get('Compile.Steps'), ]); - $container->add(SelfUpdateCommand::class) - ->withArguments([ - \Symfony\Component\Filesystem\Filesystem::class, - \Symfony\Component\Finder\Finder::class, - ]); + array_push($commands, $container->get(BuildCommand::class)); + + if (strlen(\Phar::running() > 0)) { + $container->add(SelfUpdateCommand::class) + ->withArguments([ + \Symfony\Component\Filesystem\Filesystem::class, + \Symfony\Component\Finder\Finder::class, + ]); + array_push($commands, $container->get(SelfUpdateCommand::class)); + } $container->add(MakeCommand::class) ->withArguments([ @@ -55,15 +65,12 @@ public function register() \Symfony\Component\Finder\Finder::class, ]); + array_push($commands, $container->get(MakeCommand::class)); + $container->share(Application::class) ->withArguments([ Tapestry::class, - [ - $container->get(InitCommand::class), - $container->get(BuildCommand::class), - $container->get(SelfUpdateCommand::class), - $container->get(MakeCommand::class), - ], + $commands, ]); } } From 27d63846b26a3a2c54c27740f966f367b7302742 Mon Sep 17 00:00:00 2001 From: Simon Dann Date: Wed, 20 Dec 2017 22:40:48 +0000 Subject: [PATCH 3/3] :bug: fixed borked merge --- src/Providers/CommandServiceProvider.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Providers/CommandServiceProvider.php b/src/Providers/CommandServiceProvider.php index 7815ee9..6b8b699 100644 --- a/src/Providers/CommandServiceProvider.php +++ b/src/Providers/CommandServiceProvider.php @@ -59,14 +59,6 @@ public function register() array_push($commands, $container->get(SelfUpdateCommand::class)); } - $container->add(MakeCommand::class) - ->withArguments([ - \Symfony\Component\Filesystem\Filesystem::class, - \Symfony\Component\Finder\Finder::class, - ]); - - array_push($commands, $container->get(MakeCommand::class)); - $container->share(Application::class) ->withArguments([ Tapestry::class,