WebTools-NG/script/getGitVer.cmd

10 lines
352 B
Batchfile
Raw Permalink Normal View History

2020-10-17 20:39:02 +00:00
@echo off
: Export rev to env, for the artifact
FOR /F "tokens=*" %%g IN ('git rev-parse --short HEAD') do (SET AppRev=%%g)
: Get git root directory
FOR /F "tokens=*" %%h IN ('git rev-parse --show-toplevel') do (SET root=%%h)
: get commit hash for version file
set rev={"rev":"%AppRev%"}
: Save to version file
echo %rev% > %root%/public/version.json