Skip to content

Commit

Permalink
Limit stylelint tasks to plugin directory
Browse files Browse the repository at this point in the history
  • Loading branch information
PhMemmel committed Mar 7, 2024
1 parent 158d5fd commit bccb6de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Command/GruntCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public function toGruntTask(string $task): ?GruntTaskModel
$workingDirectory = $this->plugin->directory;
}
$defaultTask = new GruntTaskModel($task, $workingDirectory);
$defaultTaskPluginWorkingDirectory = new GruntTaskModel($task, $this->plugin->directory);

switch ($task) {
case 'amd':
Expand All @@ -194,11 +195,11 @@ public function toGruntTask(string $task): ?GruntTaskModel

return new GruntTaskModel($task, $this->moodle->directory);
case 'stylelint:css':
return $this->plugin->hasFilesWithName('*.css') ? $defaultTask : null;
return $this->plugin->hasFilesWithName('*.css') ? $defaultTaskPluginWorkingDirectory : null;
case 'stylelint:less':
return $this->plugin->hasFilesWithName('*.less') ? $defaultTask : null;
return $this->plugin->hasFilesWithName('*.less') ? $defaultTaskPluginWorkingDirectory : null;
case 'stylelint:scss':
return $this->plugin->hasFilesWithName('*.scss') ? $defaultTask : null;
return $this->plugin->hasFilesWithName('*.scss') ? $defaultTaskPluginWorkingDirectory : null;
default:
return $defaultTask;
}
Expand Down

0 comments on commit bccb6de

Please sign in to comment.