Skip to content

Commit ec38a49

Browse files
committed
Clean up submodules.
We do not have the means of intialising them. If one plugin depends on another, you can add dependency using `moodle-plugin-ci add-plugin` statement in `.travis.yml` instead.
1 parent f699dd1 commit ec38a49

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Installer/MoodleInstaller.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ public function install()
9191
// Expand the path to Moodle so all other installers use absolute path.
9292
$this->moodle->directory = $this->expandPath($this->moodle->directory);
9393

94+
// If there are submodules, we clean up empty directories, since we
95+
// don't initialise them properly anyway.
96+
if (is_file($this->moodle->directory.'/.gitmodules')) {
97+
$process = new Process(sprintf('git config -f %s --get-regexp \'^submodule\..*\.path$\' | awk \'{ print $2 }\' | xargs -i rmdir "%s/{}"', $this->moodle->directory.'/.gitmodules', $this->moodle->directory));
98+
$process->setTimeout(null);
99+
$this->execute->mustRun($process);
100+
}
101+
94102
$this->getOutput()->step('Moodle assets');
95103

96104
$this->getOutput()->debug('Creating Moodle data directories');

0 commit comments

Comments
 (0)