bootstrap: don't choke on paths that have spaces in them

This commit is contained in:
Dylan K. Taylor 2019-12-30 11:58:44 +00:00
parent 54de518634
commit 0b3c4ee496

View File

@ -187,9 +187,9 @@ namespace pocketmine {
if(\Phar::running(true) === ""){ if(\Phar::running(true) === ""){
$gitPath = \pocketmine\PATH; $gitPath = \pocketmine\PATH;
if(Utils::execute("git -C $gitPath rev-parse HEAD", $out) === 0 and $out !== false and strlen($out = trim($out)) === 40){ if(Utils::execute("git -C \"$gitPath\" rev-parse HEAD", $out) === 0 and $out !== false and strlen($out = trim($out)) === 40){
$gitHash = trim($out); $gitHash = trim($out);
if(Utils::execute("git -C $gitPath diff --quiet") === 1 or Utils::execute("git -C $gitPath diff --cached --quiet") === 1){ //Locally-modified if(Utils::execute("git -C \"$gitPath\" diff --quiet") === 1 or Utils::execute("git -C \"$gitPath\" diff --cached --quiet") === 1){ //Locally-modified
$gitHash .= "-dirty"; $gitHash .= "-dirty";
} }
} }