Ensure we run git commands for bin/compile inside the root of the git repo, refs #12194
parent
2e83ead40c
commit
580f0006d6
|
@ -51,19 +51,19 @@ class Compiler
|
|||
|
||||
$process = new ProcessExecutor();
|
||||
|
||||
if (0 !== $process->execute(['git', 'log', '--pretty=%H', '-n1', 'HEAD'], $output, __DIR__)) {
|
||||
if (0 !== $process->execute(['git', 'log', '--pretty=%H', '-n1', 'HEAD'], $output, dirname(dirname(__DIR__)))) {
|
||||
throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.');
|
||||
}
|
||||
$this->version = trim($output);
|
||||
|
||||
if (0 !== $process->execute(['git', 'log', '-n1', '--pretty=%ci', 'HEAD'], $output, __DIR__)) {
|
||||
if (0 !== $process->execute(['git', 'log', '-n1', '--pretty=%ci', 'HEAD'], $output, dirname(dirname(__DIR__)))) {
|
||||
throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.');
|
||||
}
|
||||
|
||||
$this->versionDate = new \DateTime(trim($output));
|
||||
$this->versionDate->setTimezone(new \DateTimeZone('UTC'));
|
||||
|
||||
if (0 === $process->execute(['git', 'describe', '--tags', '--exact-match', 'HEAD'], $output, __DIR__)) {
|
||||
if (0 === $process->execute(['git', 'describe', '--tags', '--exact-match', 'HEAD'], $output, dirname(dirname(__DIR__)))) {
|
||||
$this->version = trim($output);
|
||||
} else {
|
||||
// get branch-alias defined in composer.json for dev-main (if any)
|
||||
|
|
Loading…
Reference in New Issue