mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: version list
This commit is contained in:
1 parent
133afd2296
commit
a718a83cd6
8 files changed
+14
-11
No files matched your search
@@ -29,6 +29,10 @@ export function addon(addonPath: string, prepend = false) {
|
||||
try {
|
||||
// Is a npm package
|
||||
const packagejson = require.resolve(`${addonPath}/package.json`);
|
||||
// eslint-disable-next-line import/no-dynamic-require
|
||||
const payload = require(packagejson);
|
||||
const name = payload.name.startsWith('@hydrooj/') ? payload.name.split('@hydrooj/')[1] : payload.name;
|
||||
global.Hydro.version[name] = payload.version;
|
||||
const modulePath = path.dirname(packagejson);
|
||||
const publicPath = path.resolve(modulePath, 'public');
|
||||
if (fs.existsSync(publicPath)) {
|
||||
|
||||
Reference in new issue
Block a user