Merge pull request #8814 from Budibase/env-var-fix-master
Environment variable type coercion fix
This commit is contained in:
commit
b0443eee0d
|
@ -67,7 +67,8 @@ const env = {
|
||||||
ENCRYPTED_TEST_PUBLIC_API_KEY: process.env.ENCRYPTED_TEST_PUBLIC_API_KEY,
|
ENCRYPTED_TEST_PUBLIC_API_KEY: process.env.ENCRYPTED_TEST_PUBLIC_API_KEY,
|
||||||
_set(key: any, value: any) {
|
_set(key: any, value: any) {
|
||||||
process.env[key] = value
|
process.env[key] = value
|
||||||
module.exports[key] = value
|
// @ts-ignore
|
||||||
|
env[key] = value
|
||||||
},
|
},
|
||||||
isDev,
|
isDev,
|
||||||
isTest,
|
isTest,
|
||||||
|
@ -82,7 +83,7 @@ if (!env.APPS_URL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean up any environment variable edge cases
|
// clean up any environment variable edge cases
|
||||||
for (let [key, value] of Object.entries(module.exports)) {
|
for (let [key, value] of Object.entries(env)) {
|
||||||
// handle the edge case of "0" to disable an environment variable
|
// handle the edge case of "0" to disable an environment variable
|
||||||
if (value === "0") {
|
if (value === "0") {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|
Loading…
Reference in New Issue