<commit_before>@echo off

call "%~dp0lib_base.cmd"
call "%%~dp0lib_console.cmd"
set lib_git=call "%~dp0lib_git.cmd"

if "%~1" == "/h" (
    %lib_base% help "%~0"
) else if "%1" neq "" (
    call :%*
)

exit /b

:read_version
:::===============================================================================
:::read_version - Get the git.exe verion
:::.
:::include:
:::.
:::  call "lib_git.cmd"
:::.
:::usage:
:::.
:::  %lib_git% read_version "[dir_path]"
:::.
:::required:
:::.
:::  [GIT SCOPE]   <in> USER | VENDORED
:::  [GIT PATH]    <in> Fully qualified path to the Git command root.
:::.
:::output:
:::.
:::  GIT_VERSION_[GIT SCOPE] <out> Env variable containing Git semantic version string
:::-------------------------------------------------------------------------------

echo CMDER_HERE1.2

    setlocal enabledelayedexpansion
    :: clear the variables
    set GIT_VERSION_%~1=

    :: set the executable path
    set "git_executable=%~2\git.exe"
    %lib_console% debug_output :read_version "Env Var - git_executable=%git_executable%"

    :: check if the executable actually exists
    if not exist "%git_executable%" (
        %lib_console% debug_output :read_version "%git_executable% does not exist."
        exit /b -255
    )

    :: get the git version in the provided directory
    for /F "tokens=1,2,3 usebackq" %%A in (`"%git_executable%" --version 2^>nul`) do (
        if /i "%%A %%B" == "git version" (
            set "GIT_VERSION=%%C"
            %lib_console% debug_output :read_version "Env Var - GIT_VERSION_%~1=!GIT_VERSION!"
        ) else (
            %lib_console% show_error "git --version" returned an inproper version string!
            pause
            exit /b
        )
    )

    endlocal & set "GIT_VERSION_%~1=%GIT_VERSION%"
    exit /b
<commit_msg>cleanup<commit_after>@echo off

call "%~dp0lib_base.cmd"
call "%%~dp0lib_console.cmd"
set lib_git=call "%~dp0lib_git.cmd"

if "%~1" == "/h" (
    %lib_base% help "%~0"
) else if "%1" neq "" (
    call :%*
)

exit /b

:read_version
:::===============================================================================
:::read_version - Get the git.exe verion
:::.
:::include:
:::.
:::  call "lib_git.cmd"
:::.
:::usage:
:::.
:::  %lib_git% read_version "[dir_path]"
:::.
:::required:
:::.
:::  [GIT SCOPE]   <in> USER | VENDORED
:::  [GIT PATH]    <in> Fully qualified path to the Git command root.
:::.
:::output:
:::.
:::  GIT_VERSION_[GIT SCOPE] <out> Env variable containing Git semantic version string
:::-------------------------------------------------------------------------------

    setlocal enabledelayedexpansion
    :: clear the variables
    set GIT_VERSION_%~1=

    :: set the executable path
    set "git_executable=%~2\git.exe"
    %lib_console% debug_output :read_version "Env Var - git_executable=%git_executable%"

    :: check if the executable actually exists
    if not exist "%git_executable%" (
        %lib_console% debug_output :read_version "%git_executable% does not exist."
        exit /b -255
    )

    :: get the git version in the provided directory
    for /F "tokens=1,2,3 usebackq" %%A in (`"%git_executable%" --version 2^>nul`) do (
        if /i "%%A %%B" == "git version" (
            set "GIT_VERSION=%%C"
            %lib_console% debug_output :read_version "Env Var - GIT_VERSION_%~1=!GIT_VERSION!"
        ) else (
            %lib_console% show_error "git --version" returned an inproper version string!
            pause
            exit /b
        )
    )

    endlocal & set "GIT_VERSION_%~1=%GIT_VERSION%"
    exit /b

{'fraction_non_alphanumeric': 0.23498034811903426, 'fraction_numerical': 0.010106681639528355, 'mean_word_length': 2.646878198567042, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '2228852', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1177, 'n_words': 306}