mirror of
https://github.com/imputnet/cobalt.git
synced 2026-01-05 00:18:12 +00:00
api/env: unquote variables if needed
This commit is contained in:
parent
ba2d266de7
commit
c392864c82
@ -120,8 +120,12 @@ const reloadEnvs = async (contents) => {
|
||||
continue;
|
||||
}
|
||||
|
||||
const [ key, value ] = line.split(/=(.+)?/);
|
||||
let [ key, value ] = line.split(/=(.+)?/);
|
||||
if (key) {
|
||||
if (value.match(/^['"]/) && value.match(/['"]$/)) {
|
||||
value = JSON.parse(value);
|
||||
}
|
||||
|
||||
newEnvs[key] = value || '';
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user