mirror of https://github.com/GooseMod/OpenAsar
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6 lines
364 B
6 lines
364 B
// Custom requireNative as Electron >=17 breaks Module.globalPaths for some reason
|
|
// For Updater v2: get direct path in globalPaths (g[0])
|
|
// For Module Updater: get root path for all modules in globalPaths
|
|
|
|
const g = require('module').globalPaths.reverse();
|
|
module.exports = (n, e = '') => require(require('path').join(g.find(x => x.includes(n)) ?? g[0], n, e)); |