Parse the target path given to cd to prevent recursive loop.

If cd was given {release_path} as target path, it would attempt to run a command to figure out what the value of {release_path} is, which, in the process, would also want to know the value of {release_path} and so on.

The fix simply parses the value as it is given, thus making the result static instead of a closure.
This commit is contained in:
Tom Rochette 2015-02-25 12:46:52 -05:00
parent 2ee23ada16
commit f3443a7615
2 changed files with 6 additions and 6 deletions

View File

@ -155,7 +155,7 @@ task('deploy:writable', function () {
$httpUser = run("ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1")->toString();
cd(env('release_path'));
cd('{release_path}');
if (strpos(run("chmod 2>&1; true"), '+a') !== false) {

View File

@ -173,7 +173,7 @@ function option($name, $shortcut = null, $mode = null, $description = '', $defau
*/
function cd($path)
{
env('working_path', $path);
env('working_path', env()->parse($path));
}
/**