[Utils > u2LoadModulePath] Fix
This commit is contained in:
parent
66f33b4665
commit
c102cf7669
1 changed files with 10 additions and 5 deletions
|
@ -1,8 +1,13 @@
|
|||
const { readdirSync } = require('fs');
|
||||
const { join } = require('path');
|
||||
const NodeModule = require('module');
|
||||
|
||||
const paths = require('../paths');
|
||||
|
||||
|
||||
module.exports = (moduleName) => {
|
||||
const NodeModule = require('module');
|
||||
const modulesDir = join(paths.getExeDir(), 'modules');
|
||||
const moduleCoreDir = readdirSync(modulesDir).find((x) => x.startsWith(moduleName + '-')); // Find desktop core dir by name
|
||||
|
||||
const modulesDir = _path.default.join(paths.getExeDir(), 'modules');
|
||||
const moduleCoreDir = _fs.default.readdirSync(modulesDir).find((x) => x.startsWith(moduleName + '-')); // Find desktop core dir by name
|
||||
|
||||
NodeModule.globalPaths.push(_path.default.join(modulesDir, moduleCoreDir)); // Add to globalPaths for requiring
|
||||
NodeModule.globalPaths.push(join(modulesDir, moduleCoreDir)); // Add to globalPaths for requiring
|
||||
};
|
Loading…
Reference in a new issue