refactored
This commit is contained in:
parent
1a6c18aff1
commit
91aecc02f4
|
@ -11,7 +11,7 @@ task('version', function()
|
|||
task('inc_game_version', function()
|
||||
{
|
||||
global $GAME_ROOT;
|
||||
$path_to_version = $GAME_ROOT . getor('VERSION_FILE', "/VERSION");
|
||||
$path_to_version = $GAME_ROOT . get_version_file();
|
||||
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 . getor('VERSION_FILE', "/VERSION"))[0]);
|
||||
return trim(file($GAME_ROOT . get_version_file())[0]);
|
||||
}
|
||||
|
||||
function game_version()
|
||||
|
@ -59,6 +59,11 @@ function game_patch_code()
|
|||
return $code;
|
||||
}
|
||||
|
||||
function get_version_file()
|
||||
{
|
||||
return '/' . getor('VERSION_FILE', "VERSION");
|
||||
}
|
||||
|
||||
function get_inc_game_version()
|
||||
{
|
||||
$string = game_version();
|
||||
|
@ -90,7 +95,7 @@ function get_version_file_lifetime()
|
|||
{
|
||||
global $GAME_ROOT;
|
||||
|
||||
exec("git log --follow --format=%ad --date=format:'%Y-%m-%d %H:%M:%S' " . $GAME_ROOT . getor('VERSION_FILE', "/VERSION") , $out, $ret);
|
||||
exec("git log --follow --format=%ad --date=format:'%Y-%m-%d %H:%M:%S' " . $GAME_ROOT . get_version_file() , $out, $ret);
|
||||
if($ret != 0)
|
||||
throw new Exception("git error");
|
||||
$minutes = (time() - strtotime($out[0])) / 60;
|
||||
|
|
Loading…
Reference in New Issue