8000 Add option to create a sample file with a custom filename and fix the run command when running with a custom event file by pedrocarrico · Pull Request #51 · motdotla/node-lambda · GitHub
[go: up one dir, main page]

Skip to content

Add option to create a sample file with a custom filename and fix the run command when running with a custom event file#51

Merged
DeviaVir merged 1 commit intomotdotla:masterfrom
pedrocarrico:master
Apr 18, 2016
Merged

Add option to create a sample file with a custom filename and fix the run command when running with a custom event file#51
DeviaVir merged 1 commit intomotdotla:masterfrom
pedrocarrico:master

Conversation

@pedrocarrico
Copy link
Contributor

Hi,

I was running my lambda function with a different event file name (-j option) and I was seeing the event.json file always being created.

I've changed the behaviour of the _createSampleFile function and added an optional argument if we want to supply a different file name and kept the behaviour of the run command of creating a new sample file but now with the file name we supply on the event file option.

Tell me what you think.

Thanks,

… run command when running with a custom event file

Lambda.prototype.run = function (program) {
this._createSampleFile('event.json');
this._createSampleFile('event.json', program.eventFile);
Copy link
Collaborator
@DeviaVir DeviaVir Apr 8, 2016

Choose a reason for hiding this comment

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

I think it would be cleaner if we would just replace this by:
this._createSampleFile(program.eventFile); and disregard https://github.com/motdotla/node-lambda/pull/51/files#diff-16b7d75b70953cbf4755508170f2f24cR21 since the default would be event.json and if you overwrite it we should use that instead.

Thoughts @pedrocarrico ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

DIsregard my comments, we do want to use the correct boilerplate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, didn't have much time to review your comments lately.
Thank you for merging 👍

Copy link
Collaborator
@DeviaVir DeviaVir Apr 19, 2016

Choose a reason for hiding this comment

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

Np, thanks for your contribution @pedrocarrico! 💃

@DeviaVir DeviaVir merged commit 1702fa4 into motdotla:master Apr 18, 2016
DeviaVir added a commit that referenced this pull request Apr 18, 2016
* Added package command to create a local zip.

Exclude *.env files from being uploaded to amazon.
Exclude .git* to exclude .gitignore.
Exclude test from zip.
Exclude packageDirectory from zip if specified.

* added test for refactored _archive method.

* Add -e to not escape \n when echo'ing

* VpcConfig support:
- http://docs.aws.amazon.com/lambda/latest/dg/API_VpcConfig.html
- http://docs.aws.amazon.com/lambda/latest/dg/vpc.html
This allows users to place their Lambda functions in specific subnets with specific security groups.

* Use AWS API 2015-03-31:
- Check if the function exists, if it does update else create new
- This API provides compatibility with VpcConfig

* Only ignore deploy.env by default

* Updated readme: MODE is no longer a thing

* Throw on failures

* - Fix rsync namespaced error
- Add editorconfig
- Ignore editorconfig

* Update to pass callback for nodejs4.3 runtime (#74)

* Update to pass callback for nodejs4.3 runtime
* Default to recommended runtime
* Add note about runtimes
* Added note on how to target v0.10.36

* Runhandler: Hotfixes

* Runhandler: Hotfixes (#75)

* Post install script second atttempt

* Post install script

* Add '-x' / '--excludeGlobs' args for general file exclusion on deploy. (2) (#80)

This lets me e.g. exclude not only `.env` but by `.env.prod` / `.env.dev`
and any other junky / sample files that happen to live in the method's
directory.  Or for that matter to move all those files into a sub-
directory and exclude that.  Less policy, more flexibility.

* Excludes: Ignore *.swp (#81)

* Ignore .swp files by default. Remove redundant deploy.env ignore from the examples.

* Add option to create a sample file with a custom filename and fix the run command when running with a custom event file (#51)

* Feature/context file (#82)

* Add context.json example
* Add contextFile -x --contextFile parameter
* fix contextFile example filename
* update setup log message
* Runhandler: Hotfixes
* Reformat to match existing whitespace
*  more reformating to match existing whitespace
* revert version back to 0.7.1
* Fix indenting

* Update changelog
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.

2 participants

0