dwyl/env2

Streamline the Warning Message to avoid cluttering people's consoles!

Closed this issue · 2 comments

At present we are printing out a large block of text:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Error: ENOENT, no such file or directory '/home/travis/build/nelsonic/hits/config.env'
Your app has invoked env2 to load a configuration file but 
we could not find the configuration file: /home/travis/build/nelsonic/hits/config.env
please follow the instructions in the README to create your
env.json file and/or ensure that you give the correct path to it 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This is an eyesore. lets fix it.

See:

  • env2/lib/env.js

    Lines 41 to 48 in a55f917

    var msg = '\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n'
    msg += e
    msg += '\nYour app has invoked env2 to load a configuration file but \n'
    msg += 'we could not find the configuration file: ' + filepath + '\n'
    msg += 'please follow the instructions in the README to create your\n'
    msg += 'env.json file and/or ensure that you give the correct path to it \n'
    msg += '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n'
    console.log(msg);
  • https://travis-ci.org/nelsonic/hits/builds/77237644#L213-L219

Streamlined it down to:

 Error: ENOENT, no such file or directory '/Users/n/code/env2/env.json'
 Your app required env2 to load a config file but the file was not found. Please see: http://git.io/vG3U

Thoughts?

Further simplified to:

 Error: ENOENT, no such file or directory '/Users/n/code/env2/env.json'
 env2 was required to load a config file but the file was not found. Please see: http://git.io/vG3UZ

env2-error-message