api/env: unquote variables if needed

This commit is contained in:
jj
2025-05-25 12:44:40 +00:00
parent ba2d266de7
commit c392864c82

View File

@@ -120,8 +120,12 @@ const reloadEnvs = async (contents) => {
continue; continue;
} }
const [ key, value ] = line.split(/=(.+)?/); let [ key, value ] = line.split(/=(.+)?/);
if (key) { if (key) {
if (value.match(/^['"]/) && value.match(/['"]$/)) {
value = JSON.parse(value);
}
newEnvs[key] = value || ''; newEnvs[key] = value || '';
} }
} }