Skip to content

Commit b3ecbe3

Browse files
committed
Robo feedabck
1 parent 60a3bce commit b3ecbe3

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/apphosting/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function discoverBackendRoot(cwd: string): string | null {
6363

6464
while (true) {
6565
const files = fs.listFiles(dir);
66-
if (files.some((file) => APPHOSTING_YAML_FILE_REGEX.test(file) || basename(file) === ".env")) {
66+
if (files.some((file) => APPHOSTING_YAML_FILE_REGEX.test(file) || file === ".env")) {
6767
return dir;
6868
}
6969

src/apphosting/env.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ export async function diffEnvs(
2929
const matched: string[] = [];
3030
const conflicts: string[] = [];
3131

32-
// Note: Can conceivably optimize this by parallelizing lookups of secret values with fetchSecrets.
33-
// Unlikely to actually cause noticeable benefits.
34-
for (const [key, value] of Object.entries(envs)) {
32+
await Promise.all(Object.entries(envs).map(async ([key, value]) => {
3533
const existingEnv = config.findEnv(doc, key);
3634
if (!existingEnv) {
3735
newVars.push(key);
38-
continue;
36+
return;
3937
}
4038

4139
let match = false;

src/commands/apphosting-env-import.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { fileExistsSync } from "../fsutils";
99
import { FirebaseError } from "../error";
1010
import { promises as fs } from "fs";
1111
import * as path from "path";
12-
import * as env from "../functions/env";
12+
import * as functionsEnv from "../functions/env";
1313
import * as config from "../apphosting/config";
1414
import * as prompt from "../prompt";
1515
import { requirePermissions } from "../requirePermissions";
@@ -57,7 +57,7 @@ export const command = new Command("apphosting:env:import")
5757
}
5858

5959
const envFileContent = await fs.readFile(envFilePath, "utf8");
60-
const { envs, errors } = env.parse(envFileContent);
60+
const { envs, errors } = functionsEnv.parse(envFileContent);
6161

6262
if (errors.length > 0) {
6363
throw new FirebaseError(`Invalid .env file: ${errors.join(", ")}`);

0 commit comments

Comments
 (0)