From 1a6c18aff1aa36c2b095681d6cb90d93c3787261 Mon Sep 17 00:00:00 2001 From: "n.pankin" Date: Wed, 17 Aug 2022 12:22:44 +0300 Subject: [PATCH] added VERSION_FILE props --- version.inc.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/version.inc.php b/version.inc.php index 95febf8..011ae8d 100644 --- a/version.inc.php +++ b/version.inc.php @@ -11,7 +11,7 @@ task('version', function() task('inc_game_version', function() { global $GAME_ROOT; - $path_to_version = $GAME_ROOT . "/VERSION"; + $path_to_version = $GAME_ROOT . getor('VERSION_FILE', "/VERSION"); ensure_write($path_to_version, get_inc_game_version()); git_try_commit($path_to_version, "inc version"); }); @@ -19,7 +19,7 @@ task('inc_game_version', function() function game_version_full_str() { global $GAME_ROOT; - return trim(file($GAME_ROOT . "/VERSION")[0]); + return trim(file($GAME_ROOT . getor('VERSION_FILE', "/VERSION"))[0]); } function game_version() @@ -90,11 +90,9 @@ function get_version_file_lifetime() { global $GAME_ROOT; - exec("git log --follow --format=%ad --date=format:\"%Y-%m-%d %H:%M:%S\" " . $GAME_ROOT . "/VERSION" , $out, $ret); - + exec("git log --follow --format=%ad --date=format:'%Y-%m-%d %H:%M:%S' " . $GAME_ROOT . getor('VERSION_FILE', "/VERSION") , $out, $ret); if($ret != 0) - throw new Exception("Can't get date from git."); - + throw new Exception("git error"); $minutes = (time() - strtotime($out[0])) / 60; return ceil($minutes);