superkhau / lice

An open source license generator and license viewer.
MIT License
55 stars 7 forks source link

Treat the environment variable LICE_USER as the default value for the default value of the user's name #2

Closed stawberri closed 8 years ago

stawberri commented 8 years ago

Having to type your name every time you want to make a new license gets a little annoying, so I decided to make a default settable as an environment variable. If the environment variable is not set, all the places where I added process.env.LICE_USER appears to also accept undefined as "no default," so nothing should be broken.

While I was testing this, I noticed that running lice -g before these changes would create a license where the name area was just replaced with "undefined." Since this is still what happens if $LICE_USER isn't set, I also tweaked the replacement code so that it wouldn't perform the replacement if the replacement text is falsy.

superkhau commented 8 years ago

@stawberri Thanks for the contribution. ;)

stawberri commented 8 years ago

Mhm! If you don't mind, when you get the chance, could you use npm version and publish so these changes could end up on npm? I'd rather be able to install lice with npm rather than having to link it from my clone of this repo.

superkhau commented 8 years ago

@stawberri Thanks for reminding me. Published as 1.1.0. https://www.npmjs.com/package/lice

stawberri commented 8 years ago

Thanks!