mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 06:55:29 +00:00
Use metadata for git hashes
This commit is contained in:
parent
3ee8f2b182
commit
1b0ed0f1b8
@ -482,7 +482,7 @@ namespace pocketmine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$gitHash = str_repeat("00", 20);
|
$gitHash = str_repeat("00", 20);
|
||||||
#ifndef COMPILE
|
|
||||||
if(\Phar::running(true) === ""){
|
if(\Phar::running(true) === ""){
|
||||||
if(Utils::execute("git rev-parse HEAD", $out) === 0){
|
if(Utils::execute("git rev-parse HEAD", $out) === 0){
|
||||||
$gitHash = trim($out);
|
$gitHash = trim($out);
|
||||||
@ -490,8 +490,14 @@ namespace pocketmine {
|
|||||||
$gitHash .= "-dirty";
|
$gitHash .= "-dirty";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$phar = new \Phar(\Phar::running(false));
|
||||||
|
$meta = $phar->getMetadata();
|
||||||
|
if(isset($meta["git"])){
|
||||||
|
$gitHash = $meta["git"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
define('pocketmine\GIT_COMMIT', $gitHash);
|
define('pocketmine\GIT_COMMIT', $gitHash);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user