Mirrowel commited on
Commit
1980665
·
1 Parent(s): 19af906

fix(cli): add quotes around executable and source paths in launcher script

Browse files

The launcher script was not properly handling file paths or executable names containing spaces, which could cause runtime errors during execution or credential management. Adding quotes ensures compatibility with paths that include spaces.

Files changed (1) hide show
  1. launcher.bat +10 -10
launcher.bat CHANGED
@@ -175,7 +175,7 @@ goto :ConfigMenu
175
  :: --- Phase 4: Execution ---
176
  :RunProxy
177
  cls
178
- set "ARGS=--host %HOST% --port %PORT%"
179
  if "%LOGGING%"=="true" (
180
  set "ARGS=%ARGS% --enable-request-logging"
181
  )
@@ -183,10 +183,10 @@ echo Starting Proxy...
183
  echo Arguments: %ARGS%
184
  echo.
185
  if "%EXECUTION_MODE%"=="exe" (
186
- start "LLM API Proxy" %EXE_NAME% %ARGS%
187
  ) else (
188
  set "PYTHONPATH=%~dp0src;%PYTHONPATH%"
189
- start "LLM API Proxy" python %SOURCE_PATH% %ARGS%
190
  )
191
  exit /b 0
192
 
@@ -195,10 +195,10 @@ cls
195
  echo Launching Credential Tool...
196
  echo.
197
  if "%EXECUTION_MODE%"=="exe" (
198
- %EXE_NAME% --add-credential
199
  ) else (
200
  set "PYTHONPATH=%~dp0src;%PYTHONPATH%"
201
- python %SOURCE_PATH% --add-credential
202
  )
203
  pause
204
  goto :MainMenu
@@ -210,7 +210,7 @@ echo Building Executable
210
  echo ==================================================
211
  echo.
212
  echo The build process will start in a new window.
213
- start "Build Process" cmd /c "pip install -r requirements.txt && pip install pyinstaller && python src/proxy_app/build.py && echo Build finished. && pause"
214
  exit /b
215
 
216
  :: --- Helper Functions ---
@@ -224,8 +224,8 @@ echo.
224
  echo Both executable and source code found.
225
  echo Please choose which to use:
226
  echo.
227
- echo 1. Executable (%EXE_NAME%)
228
- echo 2. Source Code (%SOURCE_PATH%)
229
  echo.
230
  set /p "CHOICE=Enter your choice: "
231
 
@@ -280,8 +280,8 @@ echo ==================================================
280
  echo Error
281
  echo ==================================================
282
  echo.
283
- echo Could not find the executable (%EXE_NAME%)
284
- echo or the source code (%SOURCE_PATH%).
285
  echo.
286
  echo Please ensure the launcher is in the correct
287
  echo directory or that the project has been built.
 
175
  :: --- Phase 4: Execution ---
176
  :RunProxy
177
  cls
178
+ set "ARGS=--host "%HOST%" --port %PORT%"
179
  if "%LOGGING%"=="true" (
180
  set "ARGS=%ARGS% --enable-request-logging"
181
  )
 
183
  echo Arguments: %ARGS%
184
  echo.
185
  if "%EXECUTION_MODE%"=="exe" (
186
+ start "LLM API Proxy" "%EXE_NAME%" %ARGS%
187
  ) else (
188
  set "PYTHONPATH=%~dp0src;%PYTHONPATH%"
189
+ start "LLM API Proxy" python "%SOURCE_PATH%" %ARGS%
190
  )
191
  exit /b 0
192
 
 
195
  echo Launching Credential Tool...
196
  echo.
197
  if "%EXECUTION_MODE%"=="exe" (
198
+ "%EXE_NAME%" --add-credential
199
  ) else (
200
  set "PYTHONPATH=%~dp0src;%PYTHONPATH%"
201
+ python "%SOURCE_PATH%" --add-credential
202
  )
203
  pause
204
  goto :MainMenu
 
210
  echo ==================================================
211
  echo.
212
  echo The build process will start in a new window.
213
+ start "Build Process" cmd /c "pip install -r requirements.txt && pip install pyinstaller && python "src/proxy_app/build.py" && echo Build finished. && pause"
214
  exit /b
215
 
216
  :: --- Helper Functions ---
 
224
  echo Both executable and source code found.
225
  echo Please choose which to use:
226
  echo.
227
+ echo 1. Executable ("%EXE_NAME%")
228
+ echo 2. Source Code ("%SOURCE_PATH%")
229
  echo.
230
  set /p "CHOICE=Enter your choice: "
231
 
 
280
  echo Error
281
  echo ==================================================
282
  echo.
283
+ echo Could not find the executable ("%EXE_NAME%")
284
+ echo or the source code ("%SOURCE_PATH%").
285
  echo.
286
  echo Please ensure the launcher is in the correct
287
  echo directory or that the project has been built.