X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpharext%2FPackager.php;h=23bcdc9999c52906cf6edcf0254789503c84500e;hb=686017f7a73f9dc9eba2c446db772824e843333b;hp=a422e972ece90453169560561b84195a6f24817d;hpb=f136c13716ebb8be746e4be36b27745cafb5618c;p=pharext%2Fpharext 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) {