MCPcopy Create free account
hub / github.com/firebase/firebase-tools / updateFirebaseRCProject

Function updateFirebaseRCProject

firebase-vscode/src/core/config.ts:64–89  ·  view source on GitHub ↗
(values: {
  projectAlias?: {
    alias: string;
    projectId: string;
  };
})

Source from the content-addressed store, hash-verified

62 * Write new default project to .firebaserc
63 */
64export async function updateFirebaseRCProject(values: {
65 projectAlias?: {
66 alias: string;
67 projectId: string;
68 };
69}) {
70 let didChange = false;
71 const newRCPath = path.join(currentOptions.value.cwd!, ".firebaserc");
72 const isNewRC = !firebaseRC.value?.tryReadValue;
73
74 const rc = firebaseRC.value?.tryReadValue ?? new RC(newRCPath, {});
75
76 if (
77 values.projectAlias &&
78 rc.resolveAlias(values.projectAlias.alias) !== values.projectAlias.projectId
79 ) {
80 rc.addProjectAlias(
81 values.projectAlias.alias,
82 values.projectAlias.projectId,
83 );
84 rc.save();
85 if (isNewRC) {
86 firebaseRC.value = _readRC(vscode.Uri.file(newRCPath));
87 }
88 }
89}
90
91function notifyFirebaseConfig(broker: ExtensionBrokerImpl) {
92 broker.send("notifyFirebaseConfig", {

Callers 2

requireAuthWrapperFunction · 0.90
registerProjectFunction · 0.90

Calls 4

_readRCFunction · 0.85
resolveAliasMethod · 0.80
addProjectAliasMethod · 0.80
saveMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…