49 Commits

Author SHA1 Message Date
Bèr Kessels
33b3367cff fix: add an unreachable return, to test signal termination 2022-02-16 10:38:46 +01:00
p0rth01998
9da35b5277 fix: typo update in test & ts lint update in ts 2020-05-15 08:48:45 +05:30
Todd Bluhm
e66cfc10f1
chore(package): update dependencies 2020-03-20 17:20:18 -05:00
Todd Bluhm
a665fa96ea
test: normalize paths to support windows 2020-02-21 17:25:10 -06:00
Todd Bluhm
c0ce28cb84
chore(package): updated ts-standard version
- improved code readability of options parsing
- added missing code coverage test cases
2020-02-17 17:43:08 -06:00
Todd Bluhm
020998a077
docs(readme): added expand env and silent docs
- Added some additional fun and helpful emoji to the docs
2020-02-10 00:43:27 -06:00
Todd Bluhm
27a2705706
feat(flags): add silent flag to ignore errors
- add silent flag to ignore env-cmd errors and missing file errors, but still terminate on signals and child process failures
2020-02-09 21:34:52 -06:00
Todd Bluhm
a253a62232
chore(package): update devDependencies
- fix new lint errors
- fix missing code coverage
- update ignore files
2020-02-09 20:40:20 -06:00
Todd Bluhm
f92f8b51ff
feat(signal-termination): handle error codes in the signal value
- fix improper test case termination due to signal termination listener leakage
2019-12-29 02:40:32 -06:00
Todd Bluhm
fda25184a6
chore(package): update dependencies
- fixed lint errors
2019-12-28 23:41:14 -06:00
omeid matten
8318637c48 feat: Support env vars expansion in cmd and args
This pull request adds support for expanding environment variable
expansion support. Closes #91

Since the user controls the call site of cmd-env, it only supports
basic UNIX style $var format. `%var%` (windows) or `${var}` is not
supported. However, you can escape variable expansion by escaping
the dollar sign like so `\$`.

Signed-off-by: omeid matten <public@omeid.me>
2019-11-28 16:20:42 +11:00
Todd Bluhm
5d685b67ff
feat(flags): add --verbose flag and option 2019-11-15 12:40:37 -06:00
Todd Bluhm
1cd2feb837
Fixed bug causing env-cmd to fail when no failure had occurred 2019-08-30 01:29:52 -05:00
Todd Bluhm
bbc4b78ad2
Convert over to using ts-standard
- Removed all the various eslint dependencies and added ts-standard
- Updated Readme file with some minor changes
- Updated dist folder to have one level again
2019-08-29 23:39:32 -05:00
Todd Bluhm
f5e2e33939
Updated typescript-eslint packages and fixed lint errors
- Updated commander
- Brought coverage back up to 100%
- Updated tsconfig to adhere to linter parser update
2019-08-28 03:13:50 -05:00
Gregory Waxman
ae7981691e Added Env default locations (#81)
* Added env default locations to match rc file locations

* Updated README to clarify all supported files and their formats

* Added new test to verify all env files are searched for
2019-08-28 02:25:15 -05:00
Gregory Waxman
29dcda819a Fixes #79 (#80)
* Fixes #79

* Updated tests to properly reject rather than throw and fixed another missing await
2019-08-28 02:21:53 -05:00
Todd Bluhm
5eaff2cb5a
Fix regex when parsing and preserving newline characters in env values 2019-06-05 16:05:32 -05:00
Todd Bluhm
bec00aa094
Update package.json to be more permissive with minor/patch versions
- Fix lint/tsc errors
2019-05-30 19:46:04 -05:00
Todd Bluhm
09ffda4abf
Publish v9.0.2
- Updated test cases to bring coverage back to 100%
- Updated package.json version number
- Update changelog
2019-05-30 00:58:16 -05:00
Todd Bluhm
2dafb745f7
Fix bug where command flags were stolen by commander 2019-05-05 22:27:37 -05:00
Todd Bluhm
3534069ece Add --use-shell option
- Added test cases for new option
- Fixed up other test cases
- Fixed code coverage issue
2019-05-04 05:35:26 -05:00
Todd Bluhm
25de68f281
Fix newline character parsing in .env files 2019-05-04 03:50:48 -05:00
Todd Bluhm
75a2f50311
Add polyfill for util.promisify for node v6 2019-05-04 02:44:25 -05:00
Todd Bluhm
4990ab3ccd
Add async .rc file support
- Updates to Readme file
2019-05-04 02:27:27 -05:00
Todd Bluhm
56ed009d7b
Convert EnvCmd to Typescript
- Complete rewrite and reorganization
- Expose a usable programmatic API
- Support Async .env files by accepting javascript files
- Update all libraries/dependencies
- Support for more options in the future by using commanderjs
- More thorough test cases and code-coverage
- Better handling of signal terminations for both parent and child
processes
- Use ESLint Standard with Typescript
2019-05-04 02:16:03 -05:00
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
a4b21438a1
8.0 release 2018-04-22 13:07:32 -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
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
Todd Bluhm
8d88f6164b
Fix files after js standard linter update 2017-03-02 17:42:26 -05:00
serapath
956b0efa8e UPDATE testing 2017-02-21 10:30:10 +01: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