Skip to content

Commit

Permalink
feat(cli): Also create .firebaserc when FIREBASE_PROJECT_ID env p…
Browse files Browse the repository at this point in the history
…assed (first deploy)
  • Loading branch information
leomp12 committed Jul 10, 2022
1 parent 53e4053 commit 7048e59
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
const pwd = process.cwd();

let projectId = FIREBASE_PROJECT_ID;
if (!projectId) {
if (projectId) {
if (!fs.existsSync(path.join(pwd, '.firebaserc'))) {
fs.writeFileSync(
path.join(pwd, '.firebaserc'),
JSON.stringify({ projects: { default: projectId } }, null, 2),
);
}
} else {
if (GOOGLE_APPLICATION_CREDENTIALS) {
try {
const gac = fs.readJSONSync(path.join(pwd, GOOGLE_APPLICATION_CREDENTIALS));
Expand Down

0 comments on commit 7048e59

Please sign in to comment.