Skip to content

Conversation

@KevinRansom
Copy link
Contributor

This PR deploys FSC and FSI as dotnet app with a shared platform.


pushd .\lkg & %_dotnetexe% publish project.json -o %~dp0\Tools\lkg -r win7-x64 &popd
@if ERRORLEVEL 1 echo Error: dotnet publish failed && goto :failure
echo on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is echo turned on here? The console output of the following commands will still be visible, just not what they were invoked with.

Otherwise, indention.

pushd .\lkg & %_dotnetexe% publish project.json -o %~dp0\Tools\lkg -r win7-x64 &popd
@if ERRORLEVEL 1 echo Error: dotnet publish failed && goto :failure
echo on
pushd .\lkg\fsc & %_dotnetexe% restore & popd & if ERRORLEVEL 1 echo Error:%errorlevel% dotnet restore failed & goto :failure
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error will never trigger because ERRORLEVEL will have been set to 0 by popd which should always succeed. Each of these lines should be split out into:

pushd .\lkg\fsc
%_dotnetexe% restore
if ERRORLEVEL 1 (
    echo Error:%errorlevel% dotnet restore failed
    goto failure
)
popd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brettfo
Yeah, I'm pretty sure that I thought that too. It turns out that popd doesn't alter the errorvalue.

A test script

pushd c:\temp
cd
c:\kevinransom\visualfsharp\tools\dotnetcli\dotnet restore project.json
popd
if ERRORLEVEL 1 echo Error: dotnet publish failed  && goto :failure 
cd

yields this result

c:\kevinransom\visualfsharp>pushd c:\temp

c:\temp>cd
c:\temp

c:\temp>c:\kevinransom\visualfsharp\tools\dotnetcli\dotnet restore project.json
error: project.json

c:\temp>popd

c:\kevinransom\visualfsharp>if ERRORLEVEL 1 echo Error: dotnet publish failed    && goto :failure
Error: dotnet publish failed
The system cannot find the batch label specified - failure

c:\kevinransom\visualfsharp>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, learn something new every day.

@KevinRansom KevinRansom merged commit 8ddc7ed into dotnet:master Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants