<commit_before>@echo off
setlocal
pushd "%~dp0"
call :main %*
popd
goto :EOF

:main
setlocal
set VERSION_SUFFIX=VersionSuffix=
set COMMIT_UNIX_TIME=
(for /f %%i in ('git log -1 "--format=%%ct"') do set COMMIT_UNIX_TIME=%%i) || goto :pack
if not defined COMMIT_UNIX_TIME echo Unable to determine the time of commit. Git not installed? & exit /b 1
call :dtjs %COMMIT_UNIX_TIME% > "%temp%\dt.js"
for /f %%i in ('cscript //nologo "%temp%\dt.js"') do set COMMIT_TIME=%%i
set COMMIT_HASH=
for /f %%i in ('git log -1 "--format=%%H"') do set COMMIT_HASH=%%i
if not defined COMMIT_HASH echo Unable to determine the commit hash & exit. Git not installed? /b 1
set COMMIT_HASH=%COMMIT_HASH:~0,4%
set VERSION_SUFFIX=%VERSION_SUFFIX%-alpha-%COMMIT_TIME%-%COMMIT_HASH%
:pack
call build && NuGet pack Worms.nuspec -Symbol -Properties "%VERSION_SUFFIX%"
goto :EOF

:dtjs
echo var d = new Date(0);
echo d.setUTCSeconds(%1);
echo WScript.Echo(d.getUTCFullYear() + ('0' + (d.getUTCMonth() + 1)).slice(-2) + ('0' + d.getUTCDate()).slice(-2))
goto :EOF<commit_msg>Use commit time (sortable) instead of hash for edge package version string<commit_after>@echo off
setlocal
pushd "%~dp0"
call :main %*
popd
goto :EOF

:main
setlocal
set VERSION_SUFFIX=VersionSuffix=
set COMMIT_UNIX_TIME=
(for /f %%i in ('git log -1 "--format=%%ct"') do set COMMIT_UNIX_TIME=%%i) || goto :pack
if not defined COMMIT_UNIX_TIME echo Unable to determine the time of commit. Git not installed? & exit /b 1
call :dtjs %COMMIT_UNIX_TIME% > "%temp%\dt.js"
for /f %%i in ('cscript //nologo "%temp%\dt.js"') do set COMMIT_TIME=%%i
set VERSION_SUFFIX=%VERSION_SUFFIX%-alpha-%COMMIT_TIME:~0,8%T%COMMIT_TIME:~-4%
:pack
call build && NuGet pack Worms.nuspec -Symbol -Properties "%VERSION_SUFFIX%"
goto :EOF

:dtjs
echo Number.prototype.ra = function(w) { return (w + this.valueOf()).slice(-w.length); }
echo var dt = new Date(0); dt.setUTCSeconds(%1);
echo var y  = dt.getUTCFullYear() ,
echo     mo = dt.getUTCMonth() + 1,
echo     d  = dt.getUTCDate()     ,
echo     h  = dt.getUTCHours()    ,
echo     mi = dt.getUTCMinutes()  ;
echo WScript.Echo(y + mo.ra('00') + d.ra('00') + h.ra('00') + mi.ra('00'));
goto :EOF
{'fraction_non_alphanumeric': 0.16173752310536044, 'fraction_numerical': 0.01432532347504621, 'mean_word_length': 4.667539267015707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4748238', 'n_tokens_mistral': 862, 'n_tokens_neox': 846, 'n_words': 245}