File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ export function discoverBackendRoot(cwd: string): string | null {
63
63
64
64
while ( true ) {
65
65
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" ) ) {
67
67
return dir ;
68
68
}
69
69
Original file line number Diff line number Diff line change @@ -29,13 +29,11 @@ export async function diffEnvs(
29
29
const matched : string [ ] = [ ] ;
30
30
const conflicts : string [ ] = [ ] ;
31
31
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 ] ) => {
35
33
const existingEnv = config . findEnv ( doc , key ) ;
36
34
if ( ! existingEnv ) {
37
35
newVars . push ( key ) ;
38
- continue ;
36
+ return ;
39
37
}
40
38
41
39
let match = false ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { fileExistsSync } from "../fsutils";
9
9
import { FirebaseError } from "../error" ;
10
10
import { promises as fs } from "fs" ;
11
11
import * as path from "path" ;
12
- import * as env from "../functions/env" ;
12
+ import * as functionsEnv from "../functions/env" ;
13
13
import * as config from "../apphosting/config" ;
14
14
import * as prompt from "../prompt" ;
15
15
import { requirePermissions } from "../requirePermissions" ;
@@ -57,7 +57,7 @@ export const command = new Command("apphosting:env:import")
57
57
}
58
58
59
59
const envFileContent = await fs . readFile ( envFilePath , "utf8" ) ;
60
- const { envs, errors } = env . parse ( envFileContent ) ;
60
+ const { envs, errors } = functionsEnv . parse ( envFileContent ) ;
61
61
62
62
if ( errors . length > 0 ) {
63
63
throw new FirebaseError ( `Invalid .env file: ${ errors . join ( ", " ) } ` ) ;
You can’t perform that action at this time.
0 commit comments