Skip to content

Commit

Permalink
Changed to search "puli"/"puli.phar" in the same paths
Browse files Browse the repository at this point in the history
  • Loading branch information
webmozart committed May 29, 2015
1 parent d15071a commit c42b352
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/PuliRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,16 @@ public function __construct($binDir = null)

$puliFinder = new ExecutableFinder();

// Search:
// 1. in the current working directory
// 2. in Composer's "bin-dir"
// 3. in the system path
$searchPath = array_merge(array(getcwd()), (array) $binDir);

// Search "puli.phar" in the PATH and the current directory
if (!($puli = $puliFinder->find('puli.phar', null, array(getcwd())))) {
if (!($puli = $puliFinder->find('puli.phar', null, $searchPath))) {
// Search "puli" in the PATH and Composer's "bin-dir"
if (!($puli = $puliFinder->find('puli', null, (array) $binDir))) {
if (!($puli = $puliFinder->find('puli', null, $searchPath))) {
throw new RuntimeException('The "puli"/"puli.phar" command could not be found.');
}
}
Expand Down

0 comments on commit c42b352

Please sign in to comment.