ci-info icon indicating copy to clipboard operation
ci-info copied to clipboard

Parametrable env

Open nfroidure opened this issue 7 years ago • 3 comments

Just find this plugin and would like to use it but I'm stuck with its current design.

My use case is that I need to pass in an env object instead of just process.env here https://github.com/nfroidure/metapak/blob/master/src/metapak.js#L88

Basically what I need is a isCi(env = process.env) function and something like a getInfo(env = process.env) one for the above code that is heavier.

It would also have the nice side effect to be able to to lazy compute the data provided by this plugin and only compute the informations you need. One can til memoize the function if needed then to avoid multiple runs.

The tests would probably be much simpler too.

If you agree we that, let me know, I can do the PR. It would require a major version bump though.

nfroidure avatar Feb 13 '19 04:02 nfroidure

@watson poking just in case you missed it. wdyt ?

nfroidure avatar Mar 19 '19 16:03 nfroidure

it doesn't need major version bump because the env can be optional parameter. if none is passed, it will use process.env.

@nfroidure did you find alternative? i'm also stuck.

stavalfi avatar May 03 '20 09:05 stavalfi

@stavalfi nope, just not using it atm. That said, one could just do process.env = myEnv but find it ugly and error prone.

nfroidure avatar May 03 '20 12:05 nfroidure