I have been stuck on this silly if statement, whatever i do, I cannot get the if statment to go to the correct label.
- Hitting ‘y’ works, cmd-prompt stops at START DEPLOY
- BUT, if I type ‘n’ cmd prints START DEPLOY then goes to end, instead of going direct to the cancel label.
Can you help?
:getConfirmation
set /p confirmDeploy =Confirm deployment of code [y/n] ?:
if "%confirmDeploy%"=="y". goto deployCode
if "%confirmDeploy%"=="n". goto cancelDeploy
:deployCode
ECHO START DEPLOY
goto end
:cancelDeploy
ECHO DEPLOY CANCELLED
goto end
Try this: