Merge pull request #898 from henriquebremenkanp/master

Allow subfolders copy
This commit is contained in:
Anton Medvedev 2016-11-25 15:03:00 +07:00 committed by GitHub
commit 9cd3ef9aa9

View File

@ -12,11 +12,13 @@ task('deploy:shared', function () {
$sharedPath = "{{deploy_path}}/shared";
foreach (get('shared_dirs') as $dir) {
$parentDir = dirname($dir);
// Create shared dir if it does not exist.
run("mkdir -p $sharedPath/$dir");
// Copy shared dir files if they does not exist.
run("if [ -d $(echo {{release_path}}/$dir) ]; then cp -rn {{release_path}}/$dir $sharedPath; fi");
run("if [ -d $(echo {{release_path}}/$dir) ]; then cp -rn {{release_path}}/$dir $sharedPath/$parentDir; fi");
// Remove from source.
run("if [ -d $(echo {{release_path}}/$dir) ]; then rm -rf {{release_path}}/$dir; fi");