26 Commits

Author SHA1 Message Date
Todd Bluhm
0738042dbb Initial conversion of lib over to typescript
- All env-cmd-examples repo cases passing
- Added support for default .env-cmdrc.json file
- Added flag and help text lib
- Split up project into more reasonable files/chunks of code
- Updated copyright year to 2019
2019-01-31 16:12:55 -05:00
Todd Bluhm
c541e9a308
Properly propagate the correct signals/codes from the child process 2018-04-24 03:46:04 -05:00
Todd Bluhm
569b5a9e6b
Fix bugs in parent and spawn process termination (#36)
* Fix spawn and parent process killing
- Implemented a broader solution to killing the parent/spawned process
that includes hooks for certain specific signals and then the generic
node exit event
- Added test cases to support the new termination solution

* Updated a bunch of node dependencies

* Updated change log
2018-03-21 03:02:20 -05:00
Todd Bluhm
1bf9451ae0
Stripe spaces out around equal sign when parsing an env file. (#35)
* Stripe spaces out around both key and value when parsing an env file.
2018-03-21 01:07:38 -05:00
Marcus R. Brown
7829a6c5a0 Add support for escaping double and single quoted values. (#34)
* Add support for escaping double and single quoted values.
* Add test cases for escaping quotes of values with embedded quotes.
2018-03-03 03:56:39 -06:00
Todd Bluhm
28bd3845e7 Allow for using absolute pathing, ~ pathing, and relative pathing (#30)
* Allow for using absolute pathing, ~ pathing, and relative pathing

* Add test cases for `./` and `../` pathing

* Update Readme file with new path rules
2017-09-25 13:39:06 -05:00
Todd Bluhm
bff0958576 Refactor fallback behavior to require a --fallback flag (#28)
* Refactored fallback behavior to require a --fallback flag

- By default env-cmd will no longer crash if .env or .env-cmdrc files
are not found
- In order to use the old default .env file fallback functionality a
--fallback flag must be passed

* Update minimum nodejs version and update Readme file

* Fix coverage

* Reduce minimum nodejs version down to v4

* Minor readme tweaks
2017-09-21 17:44:35 -05:00
Todd Bluhm
a73616073f Fixed coverage and updated Readme file 2017-09-21 17:12:18 -05:00
zhrren
e4947984b9 Support multiple environment name. (#16) 2017-09-21 14:38:48 -05:00
Anton Versal
7e29082fa7 fixes according to amendments 2017-04-18 12:29:50 -04:00
Anton Versal
494cddb9cd add —no-override option 2017-04-18 12:29:50 -04:00
Todd Bluhm
909df18ddb
Fix the # comment in env var name issue 2017-03-03 01:26:05 -05:00
serapath
956b0efa8e UPDATE testing 2017-02-21 10:30:10 +01:00
Alexander Praetorius
1dff4fa2a3 ADD default .env file as a fallback
If a repository contains a `.env` example file or - in case of a private repository - a `.env` file with production values,
a developer can add a local (e.g. `.env.local` file to `.gitignore`) and feed it to `env-cmd`.
So in development a custom local configuration can be used, but in production, `env-cmd` falls back to `.env`
2017-02-21 09:51:36 +01:00
Todd Bluhm
1f02ee0640 Merge pull request #15 from toddbluhm/fix-add-system-envs
Add system env vars back into the env list
2016-12-06 21:38:27 -08:00
Todd Bluhm
fbbbf13e49
Add system env vars back into the env list
- After retrieving user set envs from a file, add the system envs back
into the envs object so that envs like PATH, etc… will exist for the
spawned command
2016-12-06 21:32:09 -08:00
Todd Bluhm
6b60e3c27f
Fix bug when including a # in the env value
- Fixed a bug that caused a # symbol in the env value to be interpreted
as an inline comment
- When you want to include a # in you value, you need to wrap it in
double quotes: ENV=“some#symbol value”
2016-12-06 21:29:26 -08:00
Todd Bluhm
f37249e467
Added in support for .env-cmdrc file and updated to 3.0.0 2016-12-03 01:44:39 -06:00
Jon Scheiding
148d2ab000 Implemented handling for JavaScript files (toddbluhm/env-cmd#10) 2016-11-15 14:40:21 -05:00
Eric Lanehart
5c77fc195f Add support for JSON format
Short circuits custom parser with node’s module loader when given file has a .json extension
2016-09-15 13:01:59 -04:00
Todd Bluhm
fbb5ac6d68
Regex for parsing, support inline comments, support key value format
- Moved over to using regex for parsing the env file
- Added support for inline comments
- Added support for `key value` pairing file format
- Will now ignore invalid lines in env file, instead of throwing an error
- Removed old test cases
- Added more specific test cases
2016-08-18 16:48:40 -05:00
Todd Bluhm
39616b70b1 Removed -e/--env flags, allow # comment lines in env file, bug fixes
- Removed the -e/--env flags in favor of just requiring the first arg to
env-cmd to be the relative path to the env file
- Comments are now valid in env files using the #
- Empty lines in env file are now ignored
- Fixed bug env file no longer needs to end on a newline
2016-08-17 16:24:01 -05:00
Todd Bluhm
a2777a636c Fix test coverage 2016-08-17 01:09:58 -05:00
Todd Bluhm
39c0760630 Added help text, handle uncaught errors, added .npmignore 2016-08-17 00:55:16 -05:00
Todd Bluhm
f0bcce1441 Travis tweaks, make compatible with node v4 2016-08-16 21:50:21 -05:00
Todd Bluhm
afc512c641 Initial code commit 2016-08-16 21:34:05 -05:00