mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
Allow subfolders copy
This commit is contained in:
parent
f87868bdbd
commit
3d60adf8f0
@ -12,11 +12,13 @@ task('deploy:shared', function () {
|
|||||||
$sharedPath = "{{deploy_path}}/shared";
|
$sharedPath = "{{deploy_path}}/shared";
|
||||||
|
|
||||||
foreach (get('shared_dirs') as $dir) {
|
foreach (get('shared_dirs') as $dir) {
|
||||||
|
$parentDir = dirname($dir);
|
||||||
|
|
||||||
// Create shared dir if it does not exist.
|
// Create shared dir if it does not exist.
|
||||||
run("mkdir -p $sharedPath/$dir");
|
run("mkdir -p $sharedPath/$dir");
|
||||||
|
|
||||||
// Copy shared dir files if they does not exist.
|
// 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.
|
// Remove from source.
|
||||||
run("if [ -d $(echo {{release_path}}/$dir) ]; then rm -rf {{release_path}}/$dir; fi");
|
run("if [ -d $(echo {{release_path}}/$dir) ]; then rm -rf {{release_path}}/$dir; fi");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user