Skip to content

Commit 24729ee

Browse files
savageopswtfsayocoderabbitai[bot]
authored
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 <hi@sayo.wtf> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 5a85d7f commit 24729ee

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

client/version.cmd

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
4+
set "LERNA_FILE=..\lerna.json"
5+
6+
if not exist "%LERNA_FILE%" (
7+
echo Error: %LERNA_FILE% does not exist.
8+
exit /b 1
9+
)
10+
11+
for /f "tokens=2 delims=:, " %%a in ('findstr "version" "%LERNA_FILE%"') do (
12+
set "VERSION=%%~a"
13+
)
14+
15+
if "!VERSION!"=="" (
16+
echo Error: Unable to extract version from %LERNA_FILE%.
17+
exit /b 1
18+
)
19+
20+
if not exist "src\" mkdir src
21+
echo { "version": !VERSION! } > src\info.json
22+
if errorlevel 1 (
23+
echo Error: Failed to write src\info.json
24+
exit /b 1
25+
)

0 commit comments

Comments
 (0)