From f2838a3cfea978991fd3097368a4efdb9cffcf89 Mon Sep 17 00:00:00 2001 From: Nikita Zelencov Date: Thu, 26 May 2022 16:08:40 +0300 Subject: [PATCH] fix task for get version lifetime on windows --- version.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/version.inc.php b/version.inc.php index 367985a..95febf8 100644 --- a/version.inc.php +++ b/version.inc.php @@ -90,9 +90,11 @@ 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 . "/VERSION" , $out, $ret); + if($ret != 0) - throw new Exception("git error"); + throw new Exception("Can't get date from git."); + $minutes = (time() - strtotime($out[0])) / 60; return ceil($minutes);