Giter Club home page Giter Club logo

envy's Issues

True cross-platform tests

Story

As a developer working on this library, I want CI to test my code on both *nix and Windows operating systems, so platform specific bugs and regressions are caught.

Implementation

Setup AppVeyor CI to run the tests in an actual Windows environment.

The setup-tests.sh script will need to be made cross-platform. One possible approach would be to re-write it in Node and use glob and fs.chmod().

Resources

Windows WSL .env file permissions problem

envy requires you to put 600 as file permission on .env. Alas if your workspace is in the Windows land you cannot change the file permission from your bash environment. The problem is that Windows' permissions system is not as granular as Linux' is. You cannot set a 600 on it (at least I haven't found a way) however you can set 666, 000 or 777.

One way to solve this is changing the permissions requirements based on the platform running envy, we could settle for 666 when process.platform === 'win32'.

Add option for specifying the path to the .example file

I need to support multiple environments for my server. Also different environments have different variables. But there is not a clean/simple way to do it.
Right now to support 2 envs you will have to create .env.prod and .env.prod.example pairs for each env.

Ideally I would like to have max to files but maybe when you call:

    const env = envy({yourEnv});

and inside .env.example and .env you can have few functions???

Built-in shortcut for loading into process.env

The recipe for loading the environment variables into process.env is pretty simple, but it's nonetheless more cumbersome than it ought to be. We should include this feature as an optional part of our API.

My thought is something like:

envy.assign('.env', process.env);

Or, given that #5 will be implemented, perhaps:

envy.assign({ target : process.env });

Not sure about the names assign and target here. Suggestions for other names welcome.

File permissions check on Windows 10 platform fails

Even after performing chmod 555 .env envy throws file permission error on Windows 10 platform. This was attempted as administrator using both Cygwin and Gitbash CLIs.
In the Node v 10 REPL, fs.statSynch returns value of o444. Please refer to node documentation:
https://github.com/nodejs/node/blob/bf12414bbf4295cb47c4c8b69bc2aa6828778453/lib/fs.js#L1073
which mentions the following:
Caveats: on Windows only the write permission can be changed, and the distinction among the permissions of group, owner or others is not implemented.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.