From: Michael Wallner Date: Tue, 27 Feb 2018 13:31:45 +0000 (+0100) Subject: better error message X-Git-Tag: v4.1.2~9 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=2b97fd09b475f30027599e45e793af9610bf2a31;p=pharext%2Fpharext better error message --- diff --git a/src/pharext/Packager.php b/src/pharext/Packager.php index a422e97..23bcdc9 100644 --- a/src/pharext/Packager.php +++ b/src/pharext/Packager.php @@ -3,7 +3,6 @@ namespace pharext; use Phar; -use pharext\Exception; /** * The extension packaging command executed by bin/pharext @@ -196,9 +195,15 @@ class Packager implements Command $source = $this->download($source); $this->cleanup[] = new Task\Cleanup($source); } - $source = realpath($source); - if (!is_dir($source)) { - $source = $this->extract($source); + if (!$real = realpath($source)) { + $error = "Cannot find source '$source'"; + if ($this->args->git) { + $error .= "; did you forget to specify --branch for a remote git source?"; + } + throw new Exception($error); + } + if (!is_dir($real)) { + $source = $this->extract($real); $this->cleanup[] = new Task\Cleanup($source); if (!$this->args->git) {