Skip to content

Commit 9e53963

Browse files
committed
fix(env): try both GCP_PROJECT and GCLOUD_PROJECT (obsolete)
1 parent 1df5166 commit 9e53963

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

functions/__env.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// setup server and app options from Functions config (and mocks)
2-
const { GCLOUD_PROJECT } = process.env
2+
const { GCP_PROJECT, GCLOUD_PROJECT } = process.env
3+
const projectId = GCP_PROJECT || GCLOUD_PROJECT
34
const { pkg, server } = require('firebase-functions').config()
45
const functionName = server.functionName || 'app'
56

67
module.exports = {
78
functionName,
89
operatorToken: server && server.operator_token,
910
baseUri: (server && server.base_uri) ||
10-
`https://us-central1-${GCLOUD_PROJECT}.cloudfunctions.net/${functionName}`,
11-
hostingUri: `https://${GCLOUD_PROJECT}.web.app`,
11+
`https://us-central1-${projectId}.cloudfunctions.net/${functionName}`,
12+
hostingUri: `https://${projectId}.web.app`,
1213
pkg: {
1314
...pkg
1415
}

0 commit comments

Comments
 (0)