Skip to content

Commit

Permalink
feat: create version.cmd for windows support (elizaOS#2442)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Jan 17, 2025
1 parent 5a85d7f commit 24729ee
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions client/version.cmd
Original file line number Diff line number Diff line change
@@ -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
)

0 comments on commit 24729ee

Please sign in to comment.