aboutsummaryrefslogtreecommitdiff
path: root/build.bat
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-04-28 11:56:47 +0100
committergingerBill <bill@gingerbill.org>2021-04-28 11:56:47 +0100
commit3061dd2497130a8a8c04cd9e675a7672f8baa402 (patch)
treef988b8698270f49a9e523c5084c55ef2d709f5b9 /build.bat
parent002184cd4932e2720d4791a592d8642fe48418f4 (diff)
Update build.bat to use `wmic os get LocalDateTime /value` instead of %DATE% which is not consistent across computers
Diffstat (limited to 'build.bat')
-rw-r--r--build.bat8
1 files changed, 6 insertions, 2 deletions
diff --git a/build.bat b/build.bat
index c6a634aeb..038f02866 100644
--- a/build.bat
+++ b/build.bat
@@ -2,8 +2,12 @@
setlocal EnableDelayedExpansion
-set curr_year=%DATE:~-4%
-set curr_month=%DATE:~3,2%
+for /f "usebackq tokens=1,2 delims=,=- " %%i in (`wmic os get LocalDateTime /value`) do @if %%i==LocalDateTime (
+ set CURR_DATE_TIME=%%j
+)
+
+set curr_year=%CURR_DATE_TIME:~0,4%
+set curr_month=%CURR_DATE_TIME:~4,2%
:: Make sure this is a decent name and not generic
set exe_name=odin.exe