-
Notifications
You must be signed in to change notification settings - Fork 918
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
Conversation
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.
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. What to do if you already signed the CLAIndividual signers
Corporate signers
|
1 similar comment
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. What to do if you already signed the CLAIndividual signers
Corporate signers
|
CLAs look good, thanks! |
1 similar comment
CLAs look good, thanks! |
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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");
@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 Thank you for the contribution! If you think closing this is the wrong idea, just leave another comment. |
…-schema-folder Show codelenses based on the firemat.yaml
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