nadarei/mina — pull request #45 by dariocravero (2012-08-12 17:05:44+00:00)
Title: Cleanup fails to cd releases_path

For some strange reason having cleanup cd to deploy_to and then releases_path makes the deploy fail: it can't find the releases_path directory.

```
-----> Cleaning up old releases (keeping 3)
$ cd "/exordo-dev/instances/d0000052" || exit 15
$ cd "releases" || exit 16
! ERROR: Deploy failed.
```

When cd is combined in one command it just works fine:

```
-----> Cleaning up old releases (keeping 3)
$ cd "/exordo-dev/instances/d0000052/releases" || exit 15
$ count=0
$ remove=0
$ ls -1d [0-9]* | sort -rn | tail -n | xargs rm -rf {}

-----> Build finished
```

In this case, deploy:cleanup is called at the end of the deploy task.

Am I doing something wrong or is it a bug?