express-api-cli icon indicating copy to clipboard operation
express-api-cli copied to clipboard

fails silently when `src/config/database.js` is missing

Open lightmare opened this issue 4 years ago • 0 comments

Any command, including exp-api -v, exits with 0 status without printing anything when it can't open src/config/database.js.

There are 4 issues:

  • exp-api -v shouldn't be looking for any files to begin with

  • utils.checkLangAndDB doesn't handle error from missing ./src: https://github.com/tolustar/express-api-cli/blob/d39a7ce7f3da09188023519a595e58bb2cadc51a/bin/utils.js#L86

  • utils.checkLangAndDB attempts to print error from missing ./src/config/database.js without importing chalk: https://github.com/tolustar/express-api-cli/blob/d39a7ce7f3da09188023519a595e58bb2cadc51a/bin/utils.js#L93-L107

  • all unhandled errors are swallowed: https://github.com/tolustar/express-api-cli/blob/d39a7ce7f3da09188023519a595e58bb2cadc51a/bin/generators.js#L175

lightmare avatar Jul 24 '21 14:07 lightmare