[Debug] Try/catch so that page loads normally in case git can't be executed on host
这个提交包含在:
父节点
67b8332904
当前提交
36585d12f6
共有 1 个文件被更改,包括 31 次插入 和 26 次删除
|
|
@ -165,6 +165,8 @@
|
||||||
</div>
|
</div>
|
||||||
<?php if (file_exists('.git')) { ?>
|
<?php if (file_exists('.git')) { ?>
|
||||||
<?php
|
<?php
|
||||||
|
//Below is a failsafe where git commands fail
|
||||||
|
try {
|
||||||
$commitHash = trim(exec('git log --pretty="%H" -n1 HEAD'));
|
$commitHash = trim(exec('git log --pretty="%H" -n1 HEAD'));
|
||||||
$branch = '';
|
$branch = '';
|
||||||
$remote = '';
|
$remote = '';
|
||||||
|
|
@ -193,6 +195,9 @@
|
||||||
}
|
}
|
||||||
$tag = trim(exec('git describe --tags '.$commitHash));
|
$tag = trim(exec('git describe --tags '.$commitHash));
|
||||||
}
|
}
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
$commitHash = "";
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if($commitHash != "") { ?>
|
<?php if($commitHash != "") { ?>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用