-
Notifications
You must be signed in to change notification settings - Fork 357
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
Improve robustness of netlify-lambda function-builder-detector #1776
Improve robustness of netlify-lambda function-builder-detector #1776
Conversation
This closes netlify#1726 and will find the functions folder regardless if, and where, any arguments are passed to the 'netlify-lambda build' command
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 fix @Robin-Hoodie. This looks good and sorry for the delay reviewing it
break | ||
if (script.match(/netlify-lambda\s+build/)) { | ||
// E.g. ["netlify-lambda", "build", "functions/folder"] | ||
const match = minimist(script.split(' ')) |
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.
This isn't whitespace safe (e.g. a functions folder with a whitespace will break this), but the current approach isn't either and this works for more use cases.
🚀
- Summary
This PR fixes a few edge cases where the
netlify-lambda build
command would be detected, but would not run correctlynelify-lambda
commands (though this was already working, this was not tested)- Test plan
You can view the added tests in the commits
- Description for the changelog
Improve detection of invalid
netlify-lambda build
commands & detect functions folder regardless of options placement- A picture of a cute animal (not mandatory but encouraged)
My 2 cats when they were kittens: