Merge pull request #136 from phl0/fixGitID
Check if .git dir exists before accessing it
This commit is contained in:
commit
5749bafbbd
1 changed files with 6 additions and 2 deletions
|
@ -851,7 +851,11 @@ function decodeAlias($logLine) {
|
|||
|
||||
|
||||
function getGitVersion(){
|
||||
exec("git rev-parse HEAD", $output);
|
||||
return 'GitID #<a href="https://github.com/dg9vh/MMDVMHost-Dashboard/commit/'.substr($output[0],0,7).'">'.substr($output[0],0,7).'</a>';
|
||||
if (file_exists(".git")) {
|
||||
exec("git rev-parse HEAD", $output);
|
||||
return 'GitID #<a href="https://github.com/dg9vh/MMDVMHost-Dashboard/commit/'.substr($output[0],0,7).'">'.substr($output[0],0,7).'</a>';
|
||||
} else {
|
||||
return 'GitID unknown';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue