Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bail out of firebase init hosting:github early with helpful message if Hosting isn't set up #3114

Merged

Conversation

devpeerapong
Copy link
Contributor

Description

#3113

Scenarios Tested

  1. Create an empty project
  2. Run firebase init hosting:github
  3. The CLI should bail out before the authentication process with Firebase and Github

Sample Commands

@google-cla google-cla bot added the cla: yes Manual indication that this has passed CLA. label Feb 7, 2021
@jhuleatt jhuleatt linked an issue Dec 14, 2021 that may be closed by this pull request
@jhuleatt
Copy link
Contributor

jhuleatt commented Dec 14, 2021

Thank you @devpeerapong for your help! I suggested a change to the language in the error message. Can you also please add a line in CHANGELOG.md as part of this PR?

If you can do those two things we should be able to merge this

@jhuleatt jhuleatt changed the title fix: bail out early with helpful message when init hosting github error fix: bail out of firebase init hosting:github early with helpful message if Hosting isn't set up Dec 14, 2021
@google-cla google-cla bot added cla: no and removed cla: yes Manual indication that this has passed CLA. labels Dec 14, 2021
@google-cla google-cla bot added cla: yes Manual indication that this has passed CLA. and removed cla: no labels Dec 14, 2021
@devpeerapong
Copy link
Contributor Author

both error message and CHANGELOG.md are updated.

@@ -54,6 +54,13 @@ export async function initGitHub(setup: Setup, config: any, options: any): Promi
return reject("Could not determine Project ID, can't set up GitHub workflow.", { exit: 1 });
}

if (!setup.config.hosting) {
return reject(
`Didn't find a Hosting config in firebase.json. Run ${bold("firebase init hosting")} instead.`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run npm run format in the codebase to clear up this error

if (!setup.config.hosting) {
return reject(
`Didn't find a Hosting config in firebase.json. Run ${bold("firebase init hosting")} instead.`,
{ exit: 1 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exit: 1 is the default and can be omitted.

@bkendall bkendall merged commit 5738912 into firebase:master Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Manual indication that this has passed CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error message when running init hosting:github on a fresh project
3 participants