feat: Node.js 版 /api/utils/env 增加 meta 信息

This commit is contained in:
xream 2024-03-08 14:20:55 +08:00
parent 572f2f5533
commit 23cf81d0a5
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 16 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.241",
"version": "2.14.242",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {

View File

@ -36,6 +36,21 @@ try {
// eslint-disable-next-line no-undef
meta.script = $script;
}
if (isNode) {
meta.node = {
version: eval('process.version'),
argv: eval('process.argv'),
filename: eval('__filename'),
dirname: eval('__dirname'),
env: {},
};
const env = eval('process.env');
for (const key in env) {
if (/^SUB_STORE_/.test(key)) {
meta.node.env[key] = env[key];
}
}
}
// eslint-disable-next-line no-empty
} catch (e) {}