firebase-tools
firebase-tools copied to clipboard
Skip creating env variables with undefined values
Description
Fixes #7036. From what I can gather, it is possible that env values can be undefined.
I think we should skip the creation of env if their value is undefined.
Scenarios Tested
- Run
firebase functions:config:set test.user=test-user - Run
firebase functions:config:set some.random.planet=- Creates an env with no value
- Run `
- Outputs the ff JSON object, where
some.randomdoesn't have a value
- Outputs the ff JSON object, where
{
"some": {
"random": {}
},
"test": {
"user": "test-user"
}
- Run
firebase functions:config:export
i Importing functions configs from projects [PROJECT_ID]
i Importing configs from projects: [PROJECT_ID]
✔ Wrote functions/.env.default
✔ Wrote functions/.env.local
✔ Wrote functions/.env
The ff files are created:
.env
# Exported firebase functions:config:export command on 4/25/2024# .env file contains environment variables that applies to all projects.
.env.default
# Exported firebase functions:config:export command on 4/25/2024
TEST_USER="test-user" # from test.user
.env.local
# Exported firebase functions:config:export command on 4/25/2024
# .env.local file contains environment variables for the Functions Emulator.