Detect exec failures in compile script, refs #10693
parent
1cc23e1a8b
commit
d7f0733959
20
bin/compile
20
bin/compile
|
@ -3,16 +3,28 @@
|
||||||
|
|
||||||
$cwd = getcwd();
|
$cwd = getcwd();
|
||||||
chdir(__DIR__.'/../');
|
chdir(__DIR__.'/../');
|
||||||
$ts = rtrim(shell_exec('git log -n1 --pretty=%ct HEAD'));
|
$ts = rtrim(exec('git log -n1 --pretty=%ct HEAD'));
|
||||||
if (!is_numeric($ts)) {
|
if (!is_numeric($ts)) {
|
||||||
echo 'Could not detect date using "git log -n1 --pretty=%ct HEAD"'.PHP_EOL;
|
echo 'Could not detect date using "git log -n1 --pretty=%ct HEAD"'.PHP_EOL;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
// Install with the current version to force it having the right ClassLoader version
|
// Install with the current version to force it having the right ClassLoader version
|
||||||
// Install without dev packages to clean up the included classmap from phpunit classes
|
// Install without dev packages to clean up the included classmap from phpunit classes
|
||||||
shell_exec('php bin/composer config autoloader-suffix ComposerPhar' . $ts);
|
exec('php bin/composer config autoloader-suffix ComposerPhar' . $ts, $output, $result);
|
||||||
shell_exec('php bin/composer install -q --no-dev');
|
if (0 !== $result) {
|
||||||
shell_exec('php bin/composer config autoloader-suffix --unset');
|
echo 'Could not set the autoloader suffix, make sure exec is allowed and php can be found in your PATH';
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
exec('php bin/composer install -q --no-dev', $output, $result);
|
||||||
|
if (0 !== $result) {
|
||||||
|
echo 'Could not remove dev deps, make sure exec is allowed and php can be found in your PATH';
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
exec('php bin/composer config autoloader-suffix --unset', $output, $result);
|
||||||
|
if (0 !== $result) {
|
||||||
|
echo 'Could not remove the autoloader suffix, make sure exec is allowed and php can be found in your PATH';
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
chdir($cwd);
|
chdir($cwd);
|
||||||
|
|
||||||
require __DIR__.'/../src/bootstrap.php';
|
require __DIR__.'/../src/bootstrap.php';
|
||||||
|
|
Loading…
Reference in New Issue