projects
/
pharext
/
pharext
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
c696a9b
)
better error message
author
Michael Wallner
<mike@php.net>
Tue, 27 Feb 2018 13:31:45 +0000
(14:31 +0100)
committer
Michael Wallner
<mike@php.net>
Tue, 27 Feb 2018 13:31:45 +0000
(14:31 +0100)
src/pharext/Packager.php
patch
|
blob
|
history
diff --git
a/src/pharext/Packager.php
b/src/pharext/Packager.php
index a422e972ece90453169560561b84195a6f24817d..23bcdc9999c52906cf6edcf0254789503c84500e 100644
(file)
--- a/
src/pharext/Packager.php
+++ b/
src/pharext/Packager.php
@@
-3,7
+3,6
@@
namespace pharext;
use Phar;
namespace pharext;
use Phar;
-use pharext\Exception;
/**
* The extension packaging command executed by bin/pharext
/**
* 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 = $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) {
$this->cleanup[] = new Task\Cleanup($source);
if (!$this->args->git) {