Skip to content

Commit

Permalink
show error message when running firebase init hosting:github wihout h…
Browse files Browse the repository at this point in the history
…osting config
  • Loading branch information
devpeerapong committed Dec 14, 2021
1 parent 6ddc5ab commit 454fe00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,3 +2,4 @@
- Fixes issue with filtering on a specific storage bucket using functions in the emulator (#3893)
- Fixes check in Cloud Functions for Firebase initialization to check for API enablement before trying to enable them. (#2574)
- No longer tries to clean up function build images from Artifact Registry when Artifact Registry is not enabled (#3943)
- Show error message when running `firebase init hosting:github` with no Hosting config in `firebase.json` (#3113)
7 changes: 7 additions & 0 deletions src/init/features/hosting/github.ts
Expand Up @@ -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.`,
{ exit: 1 }
);
}

logger.info();

// Find existing Git/Github config
Expand Down

0 comments on commit 454fe00

Please sign in to comment.