From c8f0b2f53a6b4907fe500a47a13c0ebbac3f9d8b Mon Sep 17 00:00:00 2001 From: Darren Oh <2293701+darrenoh@users.noreply.github.com> Date: Sun, 23 Jul 2023 19:26:08 -0700 Subject: [PATCH 1/4] Fix installation profiles not working Closes #20 --- src/ComposerScripts.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ComposerScripts.php b/src/ComposerScripts.php index 166cd80..cac5c0d 100644 --- a/src/ComposerScripts.php +++ b/src/ComposerScripts.php @@ -57,9 +57,11 @@ public static function postDrupalScaffold() { shell_exec('patch -p1 <../scaffold/scaffold-patch-index-php.patch'); shell_exec('patch -p1 <../scaffold/scaffold-patch-update-php.patch'); - // Symlink the top-level vendor folder into the Drupal core git repo. chdir('..'); + // Symlink the top-level vendor folder into the Drupal core git repo. static::makeSymlink('../../vendor', 'repos/drupal/vendor'); + // Symlink the contrib profiles folder into the Drupal core git repo. + static::makeSymlink('../../../web/profiles/contrib', 'repos/drupal/profiles/contrib'); // Create folders for running tests. if (!file_exists('web/sites/simpletest')) { From 556cbe473f1f022ce62173140bc495610bc5da88 Mon Sep 17 00:00:00 2001 From: Darren Oh <2293701+darrenoh@users.noreply.github.com> Date: Sun, 23 Jul 2023 19:44:26 -0700 Subject: [PATCH 2/4] Fix libraries folder not working --- src/ComposerScripts.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ComposerScripts.php b/src/ComposerScripts.php index cac5c0d..760f539 100644 --- a/src/ComposerScripts.php +++ b/src/ComposerScripts.php @@ -60,6 +60,10 @@ public static function postDrupalScaffold() { chdir('..'); // Symlink the top-level vendor folder into the Drupal core git repo. static::makeSymlink('../../vendor', 'repos/drupal/vendor'); + + // Symlink the libraries folder into the Drupal core git repo. + static::makeSymlink('../../web/libraries', 'repos/drupal/libraries'); + // Symlink the contrib profiles folder into the Drupal core git repo. static::makeSymlink('../../../web/profiles/contrib', 'repos/drupal/profiles/contrib'); From ba502253424637a1661f75815cbb80bda4fe33ea Mon Sep 17 00:00:00 2001 From: Darren Oh <2293701+darrenoh@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:02:53 -0400 Subject: [PATCH 3/4] Fix missing symlinks --- src/ComposerScripts.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ComposerScripts.php b/src/ComposerScripts.php index 760f539..eef3548 100644 --- a/src/ComposerScripts.php +++ b/src/ComposerScripts.php @@ -64,8 +64,14 @@ public static function postDrupalScaffold() { // Symlink the libraries folder into the Drupal core git repo. static::makeSymlink('../../web/libraries', 'repos/drupal/libraries'); - // Symlink the contrib profiles folder into the Drupal core git repo. - static::makeSymlink('../../../web/profiles/contrib', 'repos/drupal/profiles/contrib'); + // Symlink external and custom folders into the Drupal core git repo. + foreach (['modules', 'profiles', 'sites', 'themes'] as $dir) { + foreach (scandir("web/$dir") as $sub) { + if (!file_exists("repos/drupal/$dir/$sub") && is_dir("web/$dir/$sub")) { + static::makeSymlink("../../../web/$dir/$sub", "repos/drupal/$dir/$sub"); + } + } + } // Create folders for running tests. if (!file_exists('web/sites/simpletest')) { From e14d2a95ce40ab27306d05ebf21673c6d2151ea5 Mon Sep 17 00:00:00 2001 From: Darren Oh <2293701+darrenoh@users.noreply.github.com> Date: Sun, 25 Feb 2024 07:50:36 -0500 Subject: [PATCH 4/4] Fix sites files and folders --- src/ComposerScripts.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ComposerScripts.php b/src/ComposerScripts.php index eef3548..1b703bf 100644 --- a/src/ComposerScripts.php +++ b/src/ComposerScripts.php @@ -73,6 +73,18 @@ public static function postDrupalScaffold() { } } + // Symlink sites files and folders into the the Drupal core git repo. + foreach (scandir('web/sites') as $file) { + if (!file_exists("repos/drupal/sites/$file")) { + static::makeSymlink("../../../web/sites/$file", "repos/drupal/sites/$file"); + } + } + foreach (scandir('web/sites/default') as $file) { + if (!file_exists("repos/drupal/sites/default/$file")) { + static::makeSymlink("../../../../web/sites/default/$file", "repos/drupal/sites/default/$file"); + } + } + // Create folders for running tests. if (!file_exists('web/sites/simpletest')) { mkdir('web/sites/simpletest', 0777, TRUE);