mirror of
https://github.com/moodle/moodle.git
synced 2025-03-18 22:50:19 +01:00
Merge branch 'MDL-66307' of https://github.com/timhunt/moodle
This commit is contained in:
commit
0e5f6317c1
@ -36,6 +36,7 @@
|
||||
|
||||
module.exports = ({ template, types }) => {
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const glob = require('glob');
|
||||
const cwd = process.cwd();
|
||||
|
||||
@ -72,7 +73,7 @@ module.exports = ({ template, types }) => {
|
||||
var rawContents = fs.readFileSync(file);
|
||||
var subplugins = JSON.parse(rawContents);
|
||||
|
||||
for (const [component, path] of Object.entries(subplugins)) {
|
||||
for (const [component, path] of Object.entries(subplugins.plugintypes)) {
|
||||
if (path) {
|
||||
moodlePlugins[path] = component;
|
||||
}
|
||||
@ -92,7 +93,7 @@ module.exports = ({ template, types }) => {
|
||||
*/
|
||||
function getModuleNameFromFileName(searchFileName) {
|
||||
searchFileName = fs.realpathSync(searchFileName);
|
||||
const relativeFileName = searchFileName.replace(`${cwd}/`, '');
|
||||
const relativeFileName = searchFileName.replace(`${cwd}${path.sep}`, '').replace(/\\/g, '/');
|
||||
const [componentPath, file] = relativeFileName.split('/amd/src/');
|
||||
const fileName = file.replace('.js', '');
|
||||
|
||||
@ -202,4 +203,4 @@ module.exports = ({ template, types }) => {
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user