Return promises so errors surface and validate file before setting env
Minor formatting
Make file validation synchronous and throw errors for validation before starting the promise chain
Merge pull request #2 from mammaldev/bugfix/validate-file

Bugfix/validate file