2022-07-06 22:11:29 +02:00
|
|
|
<?php
|
2022-10-14 14:18:26 +02:00
|
|
|
/* Copyright (c) 2022 OpenXE-org */
|
2022-07-06 22:11:29 +02:00
|
|
|
/*
|
|
|
|
Refresh the githash number in githash.txt
|
|
|
|
*/
|
|
|
|
$path = '../.git/';
|
|
|
|
if (!is_dir($path)) {
|
|
|
|
return;
|
|
|
|
}
|
2022-12-04 19:59:10 +01:00
|
|
|
$head = trim(file_get_contents($path . 'HEAD'));
|
|
|
|
$refs = trim(substr($head,0,4));
|
|
|
|
if ($refs == 'ref:') {
|
|
|
|
$ref = substr($head,5);
|
|
|
|
echo($path.$ref."\n");
|
|
|
|
$hash = trim(file_get_contents($path . $ref));
|
|
|
|
} else {
|
|
|
|
$hash = $head;
|
|
|
|
}
|
2022-07-06 22:11:29 +02:00
|
|
|
if (!empty($hash)) {
|
|
|
|
file_put_contents("../githash.txt", $hash);
|
|
|
|
}
|
|
|
|
?>
|