GCLOUD_PROJECT while 运行 Firebase 模拟器的价值是多少?

What is the value of GCLOUD_PROJECT while running Firebase emulators?

我运行firebase emulators:start在本地测试我的功能。
在我的函数中,我使用 GCLOUD_PROJECT 环境变量相应地初始化 firebase-admin。
GCLOUD_PROJECT 在 运行 模拟器时的值是多少?

根据这个拉取请求,GCLOUD_PROJECT 应该像这样工作:

Manually tested:

firebase emulators:exec --project foo 'env | grep GCLOUD' correctly outputs GCLOUD_PROJECT=foo
firebase emulators:exec 'env | grep GCLOUD' gives nothing if firebase.json not present
firebase emulators:exec 'env | grep GCLOUD' uses project id from firebase.json if available

此外,在 documentation 中,它指出:

There are environment variables that are automatically populated in the functions runtime and in locally emulated functions, including:

process.env.GCLOUD_PROJECT: Provides the Firebase project ID

如果它没有按您预期的方式工作,那么我建议在同一个 repo 上提交问题。