OK thanks, mystery 1 solved. Now mystery 2:
Here's the actual code:
Code: Select all
if "%branch%" == ""
%tr%mksecho ...branch not set, using: \c
%tr%sed "s/.*:\\.*h\\\(.*\)\\BOC.*/\1/g" <%techroot%\Dev\TestHarness\TestEngineGUI\bin\Debug\DLLorigin.txt
%tr%mksecho set branch=\c>%temp%\a123.bat
%tr%sed "s/.*:\\.*h\\\(.*\)\\BOC.*/\1/g" <%techroot%\Dev\TestHarness\TestEngineGUI\bin\Debug\DLLorigin.txt>>%temp%\a123.bat
type %temp%\a123.bat
call %temp%\a123.bat
del %temp%\a123.bat
echo /%branch%/
if /%branch%/ == // (
mksecho ...branch not set
goto :EOF
) else (
set br=%techroot%\%branch%
)
) else (
if /i /%branch%/ == /Main/ (
set br=%techroot%\Main
) else (
if /i "%branch:~0,7%" == "Release" (
set br=%techroot%\%branch%
) else (
set br=%techroot%\%devroot%\%branch%
)
)
)
(
123.bat is constructed to contain:
set branch=Release\123
which it does, good.
and then is executed with the call statement, so branch should be set, however it still goes into the blank branch bit saying ...branch not set. See output below:
D:\BuildTools>set branch=
D:\BuildTools>if "" == "" (
D:\BuildTools\mksecho ...branch not set, using: \c
D:\BuildTools\sed "s/.*:\\.*h\\\(.*\)\\BOC.*/\1/g" 0<d:\ReOTech\Dev\TestHarness\TestEngineGUI\bin\Debug\DLLorigin.txt
D:\BuildTools\mksecho set branch=\c 1>C:\Users\e208304\AppData\Local\Temp\a123.bat
D:\BuildTools\sed "s/.*:\\.*h\\\(.*\)\\BOC.*/\1/g" 0<d:\ReOTech\Dev\TestHarness\TestEngineGUI\bin\Debug\DLLorigin.txt 1>>C:\Users\e208304\AppData\Local\Temp\a123.bat
type C:\Users\e208304\AppData\Local\Temp\a123.bat
call C:\Users\e208304\AppData\Local\Temp\a123.bat
del C:\Users\e208304\AppData\Local\Temp\a123.bat
echo //
if // == // (
mksecho ...branch not set
goto :EOF
) else (set br=d:\ReOTech\ )
) else (if /I // == /Main/ (set br=d:\ReOTech\Main ) else (if /I "~0,7" == "Release" (set br=d:\ReOTech\ ) else (set br=d:\ReOTec
h\Dev\ ) ) )
...branch not set, using: Release\123
set branch=Release\123
D:\BuildTools>set branch=Release\123
//
...branch not set