From 10f4f09a342ef1ae1d14498ede16114ae95579df Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Tue, 19 Apr 2016 23:08:22 +0200 Subject: [PATCH] Updated bash stub, added more checks to hotfix --- src/Hotfix/Hotfix.php | 9 +++++++++ src/stubs/bash.stub | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Hotfix/Hotfix.php b/src/Hotfix/Hotfix.php index c827142..c4df8d2 100644 --- a/src/Hotfix/Hotfix.php +++ b/src/Hotfix/Hotfix.php @@ -87,16 +87,25 @@ class Hotfix public function getName() { + if (!array_key_exists('hotfix', $this->header)) { + return "Untitled hotfix"; + } return $this->header['hotfix']; } public function getInfo() { + if (!array_key_exists('info', $this->header)) { + return "No additional information"; + } return $this->header['info']; } public function getAuthor() { + if (!array_key_exists('author', $this->header)) { + return "Unknown author"; + } return $this->header['author']; } diff --git a/src/stubs/bash.stub b/src/stubs/bash.stub index a43f9a2..db928bb 100644 --- a/src/stubs/bash.stub +++ b/src/stubs/bash.stub @@ -7,7 +7,7 @@ function exec() { EC=$? if [ $EC -gt 0 ]; then echo -e "\e[31;1m[warn]\e[31;21m Command completed with exitcode $EC\e[0m" - cat $LOG + tail -n5 $LOG | awk '{ print " " $0 }' fi rm $LOG }