api: trim whitespace off env vars
This commit is contained in:
parent
cdc65d6605
commit
233fb9bf26
|
@ -59,10 +59,11 @@ class Runtime {
|
||||||
const env_content = fss.read_file_sync(env_file).toString();
|
const env_content = fss.read_file_sync(env_file).toString();
|
||||||
this.#env_vars = {};
|
this.#env_vars = {};
|
||||||
env_content
|
env_content
|
||||||
|
.trim()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map(line => line.split('=',2))
|
.map(line => line.split('=',2))
|
||||||
.forEach(([key,val]) => {
|
.forEach(([key,val]) => {
|
||||||
this.#env_vars[key] = val;
|
this.#env_vars[key.trim()] = val.trim();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return this.#env_vars;
|
return this.#env_vars;
|
||||||
|
|
Loading…
Reference in New Issue