diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index b1a0e3d..3a09019 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,7 +9,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). The format of this change log follows the advice given at [Keep a CHANGELOG](http://keepachangelog.com). ## [Unreleased] -No unreleased changes. +### Fixed +- `moodle-plugin-ci grunt` now only runs against the `yui/src` directory when configuring the YUI task. + This resolves an issue where an "Unable to find local grunt" message was reported when code was structured in a legacy + format. See #46 for more details. ## [3.0.3] - 2020-10-16 ### Changed diff --git a/src/Command/GruntCommand.php b/src/Command/GruntCommand.php index 9749d40..8942e80 100644 --- a/src/Command/GruntCommand.php +++ b/src/Command/GruntCommand.php @@ -184,12 +184,12 @@ public function toGruntTask($task) return new GruntTaskModel($task, $amdDir, 'amd/build'); case 'shifter': case 'yui': - $yuiDir = $this->plugin->directory.'/yui'; + $yuiDir = $this->plugin->directory.'/yui/src'; if (!is_dir($yuiDir)) { return null; } - return new GruntTaskModel($task, $yuiDir.'/src', 'yui/build'); + return new GruntTaskModel($task, $yuiDir, 'yui/build'); case 'gherkinlint': if ($this->moodle->getBranch() < 33 || !$this->plugin->hasBehatFeatures()) { return null; diff --git a/tests/Command/GruntCommandTest.php b/tests/Command/GruntCommandTest.php index bfa67c1..bf2e9e6 100644 --- a/tests/Command/GruntCommandTest.php +++ b/tests/Command/GruntCommandTest.php @@ -97,6 +97,16 @@ public function testToGruntTaskWithYUI() $this->assertNull($command->toGruntTask('shifter')); } + public function testToGruntTaskWithLegacyYUI() + { + $command = $this->newCommand(); + $this->fs->remove($this->pluginDir.'/yui/src'); + $this->fs->touch($this->pluginDir.'/yui/examplejs'); + + $this->assertNull($command->toGruntTask('yui')); + $this->assertNull($command->toGruntTask('shifter')); + } + public function testToGruntTaskWithGherkin() { $command = $this->newCommand();