nadarei/mina — pull request #50 by dariocravero (2012-08-23 14:10:59+00:00)
Title: Rewrote deploy:cleanup task to put it all in the same queue.

This allows you to call the task from a deploy block, let's say at the
end.

The task runs just fine when run alone because the queued commands
aren't encapsulated in a block. On deploy, each of them is isolated,
therefore the vars aren't shared and it fails to use them.

Quick bash example:

(f='test' && echo $f) && (z=$f && echo $f && echo $z)

will print 'test' and two empty lines because $f isn't there on the
second block making $z blank too.

unscoping it prints 'test' three times as expected:

f='test' && echo $f && z=$f && echo $f && echo $z