Skip to content

Commit

Permalink
improved initialization: + try ./bin/hidev
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Jul 9, 2015
1 parent 496217f commit cf2dd97
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions bin/hidev
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ for ($i = 0;$i < 9;++$i) {
}

/// run local hidev if exists
$local = realpath('./vendor/bin/hidev');
if (is_executable($local) && $local != __FILE__) {
array_shift($argv);
foreach ($argv as $v) {
$args .= ' '. escapeshellarg($v);
foreach (['./bin/hidev', './vendor/bin/hidev'] as $local) {
$bin = realpath($local);
if (is_executable($bin) && $bin != __FILE__) {
array_shift($argv);
foreach ($argv as $v) {
$args .= ' '. escapeshellarg($v);
}
passthru($bin . $args, $exitcode);
exit($exitcode);
}
passthru($local . $args, $exitcode);
exit($exitcode);
}

Yii::setAlias('@prj', $PRJDIR);
Expand Down

0 comments on commit cf2dd97

Please sign in to comment.