diff --git a/recipe/deploy/update_code.php b/recipe/deploy/update_code.php index 9352b98a9..5ec662179 100644 --- a/recipe/deploy/update_code.php +++ b/recipe/deploy/update_code.php @@ -73,7 +73,6 @@ task('deploy:update_code', function () { $strategy = get('update_code_strategy'); $target = get('target'); - $git = get('bin/git'); $targetWithDir = $target; if (!empty(get('sub_directory'))) { @@ -81,8 +80,8 @@ } if ($strategy === 'local_archive') { - $gitRoot = runLocally("$git rev-parse --show-toplevel"); - runLocally("$git -C " . quote($gitRoot) . " archive $targetWithDir -o archive.tar"); + $gitRoot = runLocally("git rev-parse --show-toplevel"); + runLocally("git -C " . quote($gitRoot) . " archive $targetWithDir -o archive.tar"); upload("$gitRoot/archive.tar", '{{release_path}}/archive.tar'); run("tar -xf {{release_path}}/archive.tar -C {{release_path}}"); run("rm {{release_path}}/archive.tar"); @@ -90,6 +89,7 @@ $rev = quote(runLocally("git rev-list $target -1")); } else { + $git = get('bin/git'); $repository = get('repository'); if (empty($repository)) {