From 3d60adf8f0d78a7be3992a6aded8ed7067eb75f4 Mon Sep 17 00:00:00 2001 From: Henrique Bremenkanp Date: Tue, 22 Nov 2016 21:46:17 -0200 Subject: [PATCH] Allow subfolders copy --- recipe/deploy/shared.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipe/deploy/shared.php b/recipe/deploy/shared.php index a021c1e23..4f88abbec 100644 --- a/recipe/deploy/shared.php +++ b/recipe/deploy/shared.php @@ -12,11 +12,13 @@ $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");