File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 21
21
"drupal-composer/drupal-scaffold" : " ^2.2" ,
22
22
"drupal/console" : " ~1.0" ,
23
23
"drupal/core" : " ~8.0" ,
24
- "drush/drush" : " ~8.0"
24
+ "drush/drush" : " ~8.0" ,
25
+ "webflo/drupal-finder" : " ^0.2.1" ,
26
+ "webmozart/path-util" : " ^2.3"
25
27
},
26
28
"require-dev" : {
27
29
"behat/mink" : " ~1.7" ,
Original file line number Diff line number Diff line change 9
9
10
10
use Composer \Script \Event ;
11
11
use Composer \Semver \Comparator ;
12
+ use DrupalFinder \DrupalFinder ;
12
13
use Symfony \Component \Filesystem \Filesystem ;
13
14
use Webmozart \PathUtil \Path ;
14
15
15
16
class ScriptHandler {
16
17
17
- protected static function getDrupalRoot ($ project_root ) {
18
- return $ project_root . '/web ' ;
19
- }
20
-
21
18
public static function createRequiredFiles (Event $ event ) {
22
19
$ fs = new Filesystem ();
23
- $ projectRoot = getcwd ();
24
- $ drupalRoot = static ::getDrupalRoot ($ projectRoot );
20
+ $ drupalFinder = new DrupalFinder ();
21
+ $ drupalFinder ->locateRoot (getcwd ());
22
+ $ drupalRoot = $ drupalFinder ->getDrupalRoot ();
25
23
26
24
$ dirs = [
27
25
'modules ' ,
@@ -44,7 +42,7 @@ public static function createRequiredFiles(Event $event) {
44
42
require_once $ drupalRoot . '/core/includes/install.inc ' ;
45
43
$ settings ['config_directories ' ] = [
46
44
CONFIG_SYNC_DIRECTORY => (object ) [
47
- 'value ' => Path::makeRelative ($ projectRoot . '/config/sync ' , $ drupalRoot ),
45
+ 'value ' => Path::makeRelative ($ drupalFinder -> getComposerRoot () . '/config/sync ' , $ drupalRoot ),
48
46
'required ' => TRUE ,
49
47
],
50
48
];
You can’t perform that action at this time.
0 commit comments