Closed Adenser closed 9 months ago
Upon further investigation, if /i
and if /I
are both correct.
I did not account for one thing of handling both lower and upper characters in a newly spawned command prompt. Command prompts from spawn (launching .bat from explorer) is set in restricted mode compared to a terminal session already in place.
@echo off
setlocal enabledelayedexpansion
Title Realtime Whipser Translation App
cls
if exist "data_whisper" (
set /p reinstall="Python environment already exists. Do you want to reinstall? [y/n]: "
if /i "!reinstall!"=="y" (
echo Deleting existing environment...
REM call data_whisper\Scripts\deactivate.bat :: Not Needed for now
rmdir /s /q data_whisper
) else (
echo Exiting...
pause
exit /b
)
)
I have changed some minor things
setlocal enabledelayedexpansion
was added to the environmental status%reinstall%
was changed to !reinstall!
to handle both y
and Y
inputs, everything else is treated as ELSE
Thank you for bringing this to my attention..
If you want to take the code I provided and put into your change, I can merge your change, or if you want to close it up to you.
I have updated the commit with your change. I hope I did it the right way because I have never updated commits before 😅
As always, thank you very much for your work!
Merged! Thank you again!
Fix issue where if statement would be ignorred and reinstallation would not happen.
I don't know if reinstalling in setup.bash works as intended, I don't have an environment to test it.