goto does not seem to set error code status.
Under TCC (28.01.14 x64 - but happening for a long time) this batch file will only print 'Really'.
Run with cmd and the RHS of the || executes.
For reference here is the scenario.
Any command line tool install with npm for a node project will install a .cmd wrapper. That .cmd wrapper will have a line that does the final tool exec like this one for the typescript compiler):
I'm guessing they do the goto as a hack to clear/set the last error status to a predictable value. <shrug>
I don't think any of the compat settings address this. I'd love a work around better than a script that hacks at all these other scripts. :(
Code:
goto Really 2>NUL || echo ... Yeah... Really
Under TCC (28.01.14 x64 - but happening for a long time) this batch file will only print 'Really'.
Run with cmd and the RHS of the || executes.
For reference here is the scenario.
Any command line tool install with npm for a node project will install a .cmd wrapper. That .cmd wrapper will have a line that does the final tool exec like this one for the typescript compiler):
Code:
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\node_modules\typescript\bin\tsc" %*
I'm guessing they do the goto as a hack to clear/set the last error status to a predictable value. <shrug>
I don't think any of the compat settings address this. I'd love a work around better than a script that hacks at all these other scripts. :(