mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 09:39:02 +08:00
feat: Node.js 版 /api/utils/env 增加 meta 信息
This commit is contained in:
parent
572f2f5533
commit
23cf81d0a5
@ -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": {
|
||||
|
@ -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) {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user