scriptcs-contrib / svm

scriptcs version manager
Apache License 2.0
43 stars 13 forks source link

Calling scriptcs in a bat file causes execution to stop #85

Open mbp opened 7 years ago

mbp commented 7 years ago

Consider the following foo.csx:

Console.WriteLine("Hello World");

Then consider the following exec.bat:

scriptcs foo.csx
echo Script executed!

When you execute exec.bat, then the output will be:

Hello World

I expected it to be:

Hello World
Script executed!

Problem seems to be, that when we run scriptcs using svm, then it stops execution of script. The same behaviour is not seen when installing using chocolatey.

beppler commented 6 years ago

This happens because the shim is a batch file (scriptcs.cmd).

So to use it inside another batch file you must execute it with call command like the example bellow.

call scriptcs foo.csx
echo Script executed!