tag:help.appveyor.com,2012-11-13:/discussions/problems/81-install-script-does-not-respect-multiple-commandsAppVeyor: Discussion 2015-01-11T16:04:41Ztag:help.appveyor.com,2012-11-13:Comment/313995592014-01-31T18:24:23Z2014-01-31T18:49:02ZInstall script does not respect multiple commands<div><p>E.g. I want to:</p>
<ol>
<li>update the gem system<br></li>
<li>install some gems</li>
</ol>
<p>If I enter the following into the 'Install script' box:<br></p>
<pre>
<code>gem update --system
gem install rake albacore zip</code>
</pre>
The entire script is concatenated into one line:<br>
<pre>
<code>gem update --systemgem install rake albacore zip</code>
</pre>
(see <a href=
"https://ci-beta.appveyor.com/project/adamralph/scriptcs-nancy/build/3">
https://ci-beta.appveyor.com/project/adamralph/scriptcs-nancy/build/3</a>).
<p>If I add extra line breaks:<br></p>
<pre>
<code>gem update --system<br>
<br>
<br>
gem install rake albacore zip</code>
</pre>
then one of the two line breaks is preserved leaving two lines, but
both the lines are sent to the command shell at once so the gem
system update succeeds and the gem installation fails (see <a href=
"https://ci-beta.appveyor.com/project/adamralph/scriptcs-nancy/build/4">
https://ci-beta.appveyor.com/project/adamralph/scriptcs-nancy/build/4</a>).
<p>I would expect that each line in the 'Install script' box is
executed and allowed to complete before the next line is
executed.</p></div>Adam Ralphtag:help.appveyor.com,2012-11-13:Comment/313995592014-01-31T18:32:23Z2014-01-31T18:32:23ZInstall script does not respect multiple commands<div><p>I will look into this!</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/313995592014-01-31T18:34:38Z2014-01-31T18:48:07ZInstall script does not respect multiple commands<div><p>Thank you - I just realised that Ruby is on the machines already
so I re-tried with just the gem update and gem installation and I
get the same problem (question is now updated).</p>
<p>I'm not sure why there is such a huge gap in the 'extra line
breaks' code sample. In the markdown I just have one blank line
between the two commands :/.</p></div>Adam Ralphtag:help.appveyor.com,2012-11-13:Comment/313995592014-01-31T18:37:36Z2014-01-31T18:37:36ZInstall script does not respect multiple commands<div><p>Yes, both Ruby and Chocolatey are pre-installed.</p>
<p>Regarding code blocks in Tender - sometimes it's really weird
and definitely it's not like at GitHub.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/313995592014-01-31T20:39:35Z2014-01-31T20:39:35ZInstall script does not respect multiple commands<div><p>Wow, this is interesting :)</p>
<p>Right now AppVeyor runs all commands from "Install" field as a
single batch file (by creating temporary .cmd and then running it
in the global PS session).</p>
<p>Apparently, <code>gem</code> command is a batch file thus the
very first <code>gem</code> command causes AppVeyor batch to exit -
the rest of commands is ignored: <a href=
"http://stackoverflow.com/questions/9773486/batch-file-closes-before-completing-all-lines">
http://stackoverflow.com/questions/9773486/batch-file-closes-before...</a></p>
<p>The solution is prepending it with "call", but I guess it'd be
better do line-by-line execution rather than treating that field as
a single script.</p>
<p>What do you think?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/313995592014-01-31T21:12:09Z2014-01-31T21:12:09ZInstall script does not respect multiple commands<div><p>It was UI bug in console rendering function combining multiple
lines to a single one.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/313995592014-01-31T22:45:51Z2014-01-31T22:45:51ZInstall script does not respect multiple commands<div><p>Thanks for the investigation! In the light of your discoveries
all the behaviour makes sense now :-).</p>
<p>I guess it probably makes sense to do line by line execution.
That would be the closest translation of intent, i.e. as if the
commands were being entered by the developer in the console, and
would follow the principle of least astonishment in case anything
goes wrong.</p></div>Adam Ralphtag:help.appveyor.com,2012-11-13:Comment/313995592014-01-31T22:54:04Z2014-01-31T22:54:04ZInstall script does not respect multiple commands<div><p>Cool, I've done line-by-line already. PS mode left as a single
piece though.</p>
<p>I'm going to deploy update (with artifact wildcards too) in a
couple of hours.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/313995592014-01-31T23:22:19Z2014-01-31T23:22:19ZInstall script does not respect multiple commands<div><p>Fantastic. Getting late here now but I'll try and give it a
whirl over the weekend. Thanks!</p></div>Adam Ralphtag:help.appveyor.com,2012-11-13:Comment/313995592014-01-31T23:23:13Z2014-01-31T23:23:13ZInstall script does not respect multiple commands<div><p>Thank you for your time! Have a nice weekend!</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/313995592014-02-01T02:26:55Z2014-02-01T02:26:55ZInstall script does not respect multiple commands<div><p>Adam,</p>
<p>I've deployed update with line-by-line script execution.</p>
<p>Give it another try when you have a chance and let me know if
you find anything else.</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/313995592014-02-01T09:21:17Z2014-02-01T09:21:17ZInstall script does not respect multiple commands<div><p>I just tried it and it worked perfectly! See <a href=
"https://ci-beta.appveyor.com/project/adamralph/scriptcs-nancy/build/11">
https://ci-beta.appveyor.com/project/adamralph/scriptcs-nancy/build/11</a></p>
<p>Thanks very much for fixing this so quickly.</p></div>Adam Ralphtag:help.appveyor.com,2012-11-13:Comment/313995592014-02-01T22:21:52Z2014-02-01T22:21:52ZInstall script does not respect multiple commands<div><p>Great, thanks for the update!</p></div>Feodor Fitsner