claudiajs / claudia

Deploy Node.js projects to AWS Lambda and API Gateway easily
https://claudiajs.com
MIT License
3.8k stars 274 forks source link

Bug: error in --config property on create loses config info. #156

Closed csepulv closed 6 years ago

csepulv commented 6 years ago

If you do the following (and bad-directory doesn't exist/isn't writable)

claudia create --region us-east-1 --handler lambda.handler --config bad-directory/config.json

claudia will create the lambda, roles, etc., but then fails, as the bad-directory doesn't exist.

saving configuration
{ Error: ENOENT: no such file or directory, open 'bad-directory/config.json'
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'bad-directory/config.json' }

But now you have a lambda without a config. While it isn't too bad to manually create the config, it would be preferable to either a) verify the config file can be written or, at minimum, b) write the config file to the console with a message instructing the user to create the config file with the given contents.

Thanks

gojko commented 6 years ago

thanks, i've fixed this and will push out the change in the next release