Skip to content

Commit

Permalink
feat: Node.js 版 /api/utils/env 增加 meta 信息
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Mar 8, 2024
1 parent 572f2f5 commit 23cf81d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
15 changes: 15 additions & 0 deletions backend/src/utils/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand Down

0 comments on commit 23cf81d

Please sign in to comment.