From 7e1d3b260e65ee010cc2c954b269d15dbc753ec8 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Fri, 17 May 2019 23:01:54 -0700 Subject: [PATCH] Fixed regression with `bin/plugin` not listing the plugins available (1c725c0) --- CHANGELOG.md | 3 ++- bin/plugin | 25 ++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e08fec6aa..43149a09b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ * Force question to install demo content in theme update [#2493](https://github.com/getgrav/grav/issues/2493) * Fixed GPM errors from blueprints not being logged [#2505](https://github.com/getgrav/grav/issues/2505) * Don't error when IP is invalid [#2507](https://github.com/getgrav/grav/issues/2507) - + * Fixed regression with `bin/plugin` not listing the plugins available (1c725c0) + # v1.6.9 ## 05/09/2019 diff --git a/bin/plugin b/bin/plugin index 6f8466d81..3c431e379 100755 --- a/bin/plugin +++ b/bin/plugin @@ -79,19 +79,6 @@ $output = new ConsoleOutput(); $output->getFormatter()->setStyle('red', new OutputFormatterStyle('red', null, array('bold'))); $output->getFormatter()->setStyle('white', new OutputFormatterStyle('white', null, array('bold'))); -if (is_null($plugin)) { - $output->writeln(''); - $output->writeln("$name plugin not found"); - die; -} - -if (!$plugin->enabled) { - $output->writeln(''); - $output->writeln("$name not enabled"); - die; -} - - if (!$name) { $output->writeln(''); $output->writeln('Usage:'); @@ -123,6 +110,18 @@ if (!$name) { } exit; +} else { + if (is_null($plugin)) { + $output->writeln(''); + $output->writeln("$name plugin not found"); + die; + } + + if (!$plugin->enabled) { + $output->writeln(''); + $output->writeln("$name not enabled"); + die; + } } if ($plugin === null) {