From 31c12c9c0d7c04c19db11aa7d723ab0fe3c099a9 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Wed, 17 Sep 2014 23:32:36 -0700 Subject: [PATCH] Fixed infoCommand author url since it's now optional --- system/src/Grav/Console/Gpm/InfoCommand.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Console/Gpm/InfoCommand.php b/system/src/Grav/Console/Gpm/InfoCommand.php index 775a222b7..be64214a7 100644 --- a/system/src/Grav/Console/Gpm/InfoCommand.php +++ b/system/src/Grav/Console/Gpm/InfoCommand.php @@ -57,7 +57,13 @@ class InfoCommand extends Command $this->output->writeln(str_repeat('-', strlen($foundPackage->name) + strlen($foundPackage->slug) + 3)); $this->output->writeln("" . strip_tags($foundPackage->description_plain) . ""); $this->output->writeln(''); - $this->output->writeln("".str_pad("Author", 12).": " . $foundPackage->author->name . ' <' . $foundPackage->author->email . '> <' . $foundPackage->author->url . '>'); + + $packageURL = ''; + if (isset($foundPackage->author->url)) { + $packageURL = '<' . $foundPackage->author->url . '>'; + } + + $this->output->writeln("".str_pad("Author", 12).": " . $foundPackage->author->name . ' <' . $foundPackage->author->email . '>'.$packageURL); foreach (array('version', 'keywords', 'date', 'homepage', 'demo', 'docs', 'guide', 'repository', 'bugs', 'zipball_url', 'license') as $info) { if (isset($foundPackage->$info)) {