Merge branch 'MDL-67712-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
@@ -163,8 +163,10 @@ const getComponentFromPath = path => {
|
||||
const getOwningComponentDirectory = checkPath => {
|
||||
const path = require('path');
|
||||
|
||||
const pathList = fetchComponentData().components;
|
||||
for (const componentPath of Object.keys(pathList)) {
|
||||
// Fetch all components into a reverse sorted array.
|
||||
// This ensures that components which are within the directory of another component match first.
|
||||
const pathList = Object.keys(fetchComponentData().components).sort().reverse();
|
||||
for (const componentPath of pathList) {
|
||||
if (checkPath === componentPath) {
|
||||
return componentPath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user