Skip to content

Commit

Permalink
Add a message if the public folder is not declared in the hosting con…
Browse files Browse the repository at this point in the history
…fig (#2015)

* Add a message if the public folder is not declared in the hosting config

* Add changelog entry for public parameter warning

* change changelog to a list

Co-authored-by: Bryan Kendall <[email protected]>
  • Loading branch information
kmcnellis and bkendall authored Mar 6, 2020
1 parent 5860f52 commit 9c687ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Adds warning message when installing a closed or open alpha extension.
Adds support for scheduled pubsub functions to pubsub emulator.
- Adds warning message when installing a closed or open alpha extension.
- Adds support for scheduled pubsub functions to pubsub emulator.
- Returns an error if the `public` parameter is not configured for Hosting in `firebase.json` or via the `-p` parameter.
6 changes: 6 additions & 0 deletions src/deploy/hosting/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ module.exports = function(context, options) {
throw new FirebaseError('Must supply either "site" or "target" in each "hosting" config.');
}

if (!cfg.public) {
throw new FirebaseError(
'Must supply a public directory using "public" in each "hosting" config.'
);
}

if (!fsutils.dirExistsSync(resolveProjectPath(options.cwd, cfg.public))) {
throw new FirebaseError(
`Specified public directory '${cfg.public}' does not exist, ` +
Expand Down

0 comments on commit 9c687ad

Please sign in to comment.