Skip to content

best way to save what you love

api/env: unquote variables if needed

jjc392864c8234
diff --git a/api/src/core/env.js b/api/src/core/env.js
index b50afd1c..4e41760c 100644
--- a/api/src/core/env.js
+++ b/api/src/core/env.js
@@ -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 || '';
}
}