From 24729eeea3d923fb7346714d948734ba0cbfb82a Mon Sep 17 00:00:00 2001 From: Savage <94788596+savageops@users.noreply.github.com> Date: Fri, 17 Jan 2025 20:40:33 +0200 Subject: [PATCH] feat: create version.cmd for windows support (#2442) * Create version.cmd Initial Error Investigation - Encountered build error in client package - Error indicated `version.sh` script couldn't be executed on Windows. Windows Script Compatibility Fix - Examined original `version.sh` shell script functionality - Created equivalent `version.cmd` batch script for Windows - Updated script to use Windows-compatible commands: * Update client/version.cmd Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Sayo Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- client/version.cmd | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 client/version.cmd diff --git a/client/version.cmd b/client/version.cmd new file mode 100644 index 00000000000..20953fdd488 --- /dev/null +++ b/client/version.cmd @@ -0,0 +1,25 @@ +@echo off +setlocal enabledelayedexpansion + +set "LERNA_FILE=..\lerna.json" + +if not exist "%LERNA_FILE%" ( + echo Error: %LERNA_FILE% does not exist. + exit /b 1 +) + +for /f "tokens=2 delims=:, " %%a in ('findstr "version" "%LERNA_FILE%"') do ( + set "VERSION=%%~a" +) + +if "!VERSION!"=="" ( + echo Error: Unable to extract version from %LERNA_FILE%. + exit /b 1 +) + +if not exist "src\" mkdir src +echo { "version": !VERSION! } > src\info.json +if errorlevel 1 ( + echo Error: Failed to write src\info.json + exit /b 1 +)