mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Updated the heredoc example in Capistrano 3 release announcement to be more explicit about a caveat with SSHKit adding ;
if then
is followed by a newline (fixes capistrano/capistrano#812)
This commit is contained in:
parent
e2bee24621
commit
a5fb0b2260
2 changed files with 15 additions and 6 deletions
|
@ -432,12 +432,15 @@ for example:
|
|||
# Capistrano 3.0.x
|
||||
execute <<-EOBLOCK
|
||||
# All of this block is interpreted as Bash script
|
||||
if ! [ -e /tmp/somefile ]; then
|
||||
touch /tmp/somefile
|
||||
if ! [ -e /tmp/somefile ]
|
||||
then touch /tmp/somefile
|
||||
chmod 0644 /tmp/somefile
|
||||
end
|
||||
EOBLOCK
|
||||
{% endprism %}
|
||||
|
||||
**Caveat:** The SSHKit multiline command sanitizing logic will remove line feeds and add an `;` after each line to separate the commands. So make sure you are not putting a newline between `then` and the following command.
|
||||
|
||||
The idiomatic way to write that command in Capistrano v3 is to use the
|
||||
separated variadaric method to specify the command:
|
||||
|
||||
|
|
|
@ -550,12 +550,15 @@ for example:</p>
|
|||
<pre data-line=''><code class='language-ruby'># Capistrano 3.0.x
|
||||
execute <<-EOBLOCK
|
||||
# All of this block is interpreted as Bash script
|
||||
if ! [ -e /tmp/somefile ]; then
|
||||
touch /tmp/somefile
|
||||
if ! [ -e /tmp/somefile ]
|
||||
then touch /tmp/somefile
|
||||
chmod 0644 /tmp/somefile
|
||||
end
|
||||
EOBLOCK</code></pre>
|
||||
</div>
|
||||
|
||||
<p><strong>Caveat:</strong> The SSHKit multiline command sanitizing logic will remove line feeds and add an <code>;</code> after each line to separate the commands. So make sure you are not putting a newline between <code>then</code> and the following command.</p>
|
||||
|
||||
<p>The idiomatic way to write that command in Capistrano v3 is to use the
|
||||
separated variadaric method to specify the command:</p>
|
||||
|
||||
|
@ -1137,12 +1140,15 @@ for example:</p>
|
|||
<pre data-line=''><code class='language-ruby'># Capistrano 3.0.x
|
||||
execute <<-EOBLOCK
|
||||
# All of this block is interpreted as Bash script
|
||||
if ! [ -e /tmp/somefile ]; then
|
||||
touch /tmp/somefile
|
||||
if ! [ -e /tmp/somefile ]
|
||||
then touch /tmp/somefile
|
||||
chmod 0644 /tmp/somefile
|
||||
end
|
||||
EOBLOCK</code></pre>
|
||||
</div>
|
||||
|
||||
<p><strong>Caveat:</strong> The SSHKit multiline command sanitizing logic will remove line feeds and add an <code>;</code> after each line to separate the commands. So make sure you are not putting a newline between <code>then</code> and the following command.</p>
|
||||
|
||||
<p>The idiomatic way to write that command in Capistrano v3 is to use the
|
||||
separated variadaric method to specify the command:</p>
|
||||
|
||||
|
|
Loading…
Reference in a new issue