At the moment, the idea i have is to used the firebase projects:list and allow the user to select the project they so desire to use, but I am open to a better implementation of the idea:
Examples code snippet I wrote:
if (!firebaseProjectId) {
// run in the CLI firebase list to list all firebase projects and let the
// user choose
const res = execSync('firebase projects:list');
console.log(
res
?.toString()
.split('\n')
.map((line) =>
line
.replace(/-/g, '')
.split('│')
.map((line) => line.trim())
.filter((content) => content !== '')
)
.filter((line) => line.length > 1)
);
return;
}
At the moment, the idea i have is to used the
firebase projects:listand allow the user to select the project they so desire to use, but I am open to a better implementation of the idea:Examples code snippet I wrote: