firebase-tools 12.6.1 → 12.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -91,7 +91,7 @@ async function createFunction(cloudFunction) {
|
|
|
91
91
|
const components = cloudFunction.name.split("/");
|
|
92
92
|
const functionId = components.splice(-1, 1)[0];
|
|
93
93
|
cloudFunction.buildConfig.environmentVariables = Object.assign(Object.assign({}, cloudFunction.buildConfig.environmentVariables), { GOOGLE_NODE_RUN_SCRIPTS: "" });
|
|
94
|
-
cloudFunction.serviceConfig.environmentVariables = Object.assign(Object.assign({}, cloudFunction.serviceConfig.environmentVariables), { FUNCTION_TARGET: functionId.
|
|
94
|
+
cloudFunction.serviceConfig.environmentVariables = Object.assign(Object.assign({}, cloudFunction.serviceConfig.environmentVariables), { FUNCTION_TARGET: functionId.replaceAll("-", ".") });
|
|
95
95
|
try {
|
|
96
96
|
const res = await client.post(components.join("/"), cloudFunction, { queryParams: { functionId } });
|
|
97
97
|
return res.body;
|
|
@@ -149,7 +149,7 @@ async function updateFunction(cloudFunction) {
|
|
|
149
149
|
const fieldMasks = proto.fieldMasks(cloudFunction, "labels", "serviceConfig.environmentVariables", "serviceConfig.secretEnvironmentVariables");
|
|
150
150
|
cloudFunction.buildConfig.environmentVariables = Object.assign(Object.assign({}, cloudFunction.buildConfig.environmentVariables), { GOOGLE_NODE_RUN_SCRIPTS: "" });
|
|
151
151
|
fieldMasks.push("buildConfig.buildEnvironmentVariables");
|
|
152
|
-
cloudFunction.serviceConfig.environmentVariables = Object.assign(Object.assign({}, cloudFunction.serviceConfig.environmentVariables), { FUNCTION_TARGET: functionId.
|
|
152
|
+
cloudFunction.serviceConfig.environmentVariables = Object.assign(Object.assign({}, cloudFunction.serviceConfig.environmentVariables), { FUNCTION_TARGET: functionId.replaceAll("-", ".") });
|
|
153
153
|
try {
|
|
154
154
|
const queryParams = {
|
|
155
155
|
updateMask: fieldMasks.join(","),
|
package/lib/gcp/storage.js
CHANGED
|
@@ -6,21 +6,19 @@ const api_1 = require("../api");
|
|
|
6
6
|
const apiv2_1 = require("../apiv2");
|
|
7
7
|
const error_1 = require("../error");
|
|
8
8
|
const logger_1 = require("../logger");
|
|
9
|
-
const
|
|
9
|
+
const projects_1 = require("../management/projects");
|
|
10
10
|
async function getDefaultBucket(projectId) {
|
|
11
11
|
var _a;
|
|
12
|
-
await (0, ensureApiEnabled_1.ensure)(projectId, "firebasestorage.googleapis.com", "storage", false);
|
|
13
12
|
try {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
if (!((_a = response.body) === null || _a === void 0 ? void 0 : _a.name)) {
|
|
13
|
+
const metadata = await (0, projects_1.getFirebaseProject)(projectId);
|
|
14
|
+
if (!((_a = metadata.resources) === null || _a === void 0 ? void 0 : _a.storageBucket)) {
|
|
17
15
|
logger_1.logger.debug("Default storage bucket is undefined.");
|
|
18
16
|
throw new error_1.FirebaseError("Your project is being set up. Please wait a minute before deploying again.");
|
|
19
17
|
}
|
|
20
|
-
return
|
|
18
|
+
return metadata.resources.storageBucket;
|
|
21
19
|
}
|
|
22
20
|
catch (err) {
|
|
23
|
-
logger_1.logger.info("\n\nThere was an issue deploying your
|
|
21
|
+
logger_1.logger.info("\n\nThere was an issue deploying your functions. Verify that your project has a Google App Engine instance setup at https://console.cloud.google.com/appengine and try again. If this issue persists, please contact support.");
|
|
24
22
|
throw err;
|
|
25
23
|
}
|
|
26
24
|
}
|