Skip to content

Commit

Permalink
Fix firebase RC not being read before project init (#7935)
Browse files Browse the repository at this point in the history
  • Loading branch information
hlshen authored Nov 12, 2024
1 parent a02e52f commit d3a522b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions firebase-vscode/src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@ export async function updateFirebaseRCProject(values: {
};
}) {
let didChange = false;
const rc =
firebaseRC.value?.tryReadValue ??
// We don't update firebaseRC if we create a temporary RC,
// as the file watcher will update the value for us.
// This is only for the sake of calling `save()`.
new RC(path.join(currentOptions.value.cwd, ".firebaserc"), {});
const newRCPath = path.join(currentOptions.value.cwd, ".firebaserc");
const isNewRC = !firebaseRC.value?.tryReadValue;

const rc = firebaseRC.value?.tryReadValue ?? new RC(newRCPath, {});

if (
values.projectAlias &&
Expand All @@ -84,6 +82,9 @@ export async function updateFirebaseRCProject(values: {
values.projectAlias.projectId,
);
rc.save();
if (isNewRC) {
firebaseRC.value = _readRC(vscode.Uri.file(newRCPath));
}
}
}

Expand Down

0 comments on commit d3a522b

Please sign in to comment.