Skip to content

Commit 1156c71

Browse files
authored
Merge pull request #34 from erfanimani/compilation-improvements
Fixes #29: Generated directory is now cleared before DI compilation.
2 parents 79912ae + b60c880 commit 1156c71

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

recipe/magento_2_2.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
require __DIR__ . '/magento_2_2/database.php';
1515
require __DIR__ . '/magento_2_2/config.php';
1616
require __DIR__ . '/magento_2_2/crontab.php';
17+
require __DIR__ . '/magento_2_2/files.php';
1718
require __DIR__ . '/magento_2_2/rollback.php';
1819

1920
desc('Build Artifact');
@@ -24,6 +25,7 @@
2425
$origStaticOptions = get('static_deploy_options');
2526
set('static_deploy_options', '-f ' . $origStaticOptions);
2627

28+
invoke('files:remove-generated');
2729
invoke('deploy:vendors');
2830
invoke('config:remove-dev-modules');
2931
invoke('files:generate');

recipe/magento_2_2/files.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Deployer;
4+
5+
// For Magento versions 2.2.6 and after, pre-existing generated directory needs to be cleared.
6+
// Also see https://github.com/jalogut/magento2-deployer-plus/issues/29
7+
task(
8+
'files:remove-generated',
9+
'cd {{magento_dir}} && rm -rf generated/*'
10+
);

0 commit comments

Comments
 (0)