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

Added Errors if a source directory is not defined. #834

Closed
wants to merge 5 commits into from

Conversation

dark-swordsman
Copy link

Referencing #833, I had an issue where I didn't specify a source directory and Node's path.resolve() was throwing an error, which was useless information.

For newbies to firebase like me, this should drastically help.

Description

Scenarios Tested

Sample Commands

Referencing firebase#833, I had an issue where I didn't specify a source directory and Node's `path.resolve()` was throwing an error, which was useless information.

For newbies to firebase like me, this should drastically help.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@googlebot
Copy link

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

@laurenzlong laurenzlong self-assigned this Jul 26, 2018
Copy link
Contributor

@laurenzlong laurenzlong left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! See review comments inline

"Project Root Directory is not a string. Please change your directory under firebase.json to be a valid string for the source paramter."
);
}
if (!projectRootDir) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The second if statement is not necessary, since typeof undefined would return "undefined" and therefore be caught by the first if statement. Could you also revise the error message to:

      throw new FirebaseError(
        chalk.bold("firebase.json") +
          " is missing a " +
          chalk.bold("source") +
          " field in the " +
          chalk.bold("functions") +
          " object. Please add one, and specify the source directory for your functions. For example:\n" +
          chalk.bold('\t"functions": {\n\t\t"source": "functions"\n\t}')
      );

You will also need to add this at the top of the file:
var FirebaseError = require("../../error");

@samtstern
Copy link
Contributor

@dark-swordsman since @laurenzlong requested changes over a year ago I am going to close this as being out of date. If you think you still want to pursue this PR, I would suggest opening a new one since master has moved so much since you started this.

Thank you for the contribution! If you think closing this is the wrong idea, just leave another comment.

@samtstern samtstern closed this Oct 29, 2019
joehan pushed a commit that referenced this pull request Apr 26, 2024
…-schema-folder

Show codelenses based on the firemat.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants