mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
judge: trim environment variables
This commit is contained in:
1 parent
6d5eb422f9
commit
75cba6ebf6
2 files changed
+6
-1
No files matched your search
@@ -78,6 +78,8 @@ env:
|
||||
default: |
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
HOME=/w
|
||||
# modify to your python version installed
|
||||
PYTHONPATH=/lib/python3.10/site-packages
|
||||
secret:
|
||||
type: text
|
||||
name: secret
|
||||
|
||||
@@ -83,7 +83,10 @@ function proc(params: Parameter): Cmd {
|
||||
const memory = params.memory || parseMemoryMB(getConfig('memoryMax'));
|
||||
return {
|
||||
args: parseArgs(params.execute || ''),
|
||||
env: [...getConfig('env').split('\n'), ...Object.entries(params.env || {}).map(([k, v]) => `${k}=${v.replace(/=/g, '\\=')}`)],
|
||||
env: [
|
||||
...getConfig('env').split('\n').map((i) => i.trim()).filter((i) => i.startsWith('#')),
|
||||
...Object.entries(params.env || {}).map(([k, v]) => `${k}=${v.replace(/=/g, '\\=')}`),
|
||||
],
|
||||
files: [
|
||||
params.filename ? { content: '' } : stdin,
|
||||
{ name: 'stdout', max: Math.floor(1024 * 1024 * size) },
|
||||
|
||||
Reference in new issue
Block a user