mirror of
https://github.com/toddbluhm/env-cmd.git
synced 2025-12-08 18:23:33 +00:00
8.7 KiB
8.7 KiB
Changelog
11.0.0
- BREAKING: Drop support for nodejs
v8tov20.9. The minimum supported nodejs version is nowv20.10. - BREAKING: Must use
--to separate theenv-cmdflags from the command to execute (env-cmd -f .env -- node index.js). - BREAKING: Removed
-rflag and use only-fflag. - BREAKING: Support inline comments in
.envfiles. A#character now signifies the start of an inline comment, unless the value is surrounded by quotation marks ("). - BREAKING: Migrated the repository to ESM modules instead of CommonJS.
- BREAKING: Support variable expansion using curly-brace syntax (
${MY_VAR}), when the-xoption is enabled. - Feature: Support loading env variables from
.cjsand.mjsfiles. - Feature: Support loading env variables from
.ts,.cts, and.mtsfiles. - Feature: When loading an invalid JSON file, show the original parse error.
- Feature: Add a more helpful error message when trying to invoke env-cmd as a standalone command.
- Feature: Added support for nested env variables within env files with the
--recursiveflag - Docs: clarify how variable expansion works.
- Internal: Replaced Travis CI with GitHub Actions, run unit tests on windows.
- Internal: Configure automatic releases to npm from GitHub Actions
- Internal: Refactor the loader logic, to make it easier to add other loaders.
- Upgrade: Update all dependencies.
- Upgrade: Upgraded all devDependencies
10.1.0
- Feature: Added support for expanding vars using the
-xflag. Note: only supports$varsyntax - Feature: Added support for
--silentflag that ignores env-cmd errors and missing files and only terminates on caught signals - Feature: Added a new
--verboseflag that prints additional debugging info toconsole.info - Upgrade: Upgraded dependency
commanderto4.x - Upgrade: Upgraded devDependencies
sinon,nyc, andts-standard - Fix: Handle case where the termination signal is the termination code
10.0.1
- Fix: Fixed bug introduced by strict equal checking for
undefinedwhen the value wasnull. This bug caused most executions ofenv-cmdto fail with an error, when in fact no error had occurred.
10.0.0
- BREAKING: Typescript now targets ES2017
- Fix: Default RC files will now properly be searched
- Change: Fixed some documentation issues
- Change: Use
ts-standardinstead ofeslintfor linting
9.0.3
- Fix: Use global flag on regex when parsing and preserving newline characters in env values (thanks to MaximTovstashev)
9.0.2
- Fix: CLI will now exit with non-zero error code when an error is encountered (thanks to blagh)
9.0.1
- BREAKING: Fixed major bug that required passing
--in order to pass flags to the command. Normally I release major breaking changes as major versions, but this was a bug and no documentation anywhere states using--as intended or official behavior. - Change: Fixed some documentation issues
- Change:
npm run lintcommand now includes callingtscto check for typescript errors
9.0.0
- BREAKING: Converted project to Typescript
- BREAKING: Changes to all option flags, see docs for new options
- BREAKING: Dropping support for node v4 and v6
- Change: Updated all dependencies
- Change: Update package-lock.json file
- Feature: Added support for asynchronous .env and .rc files
- Feature: Added support for a programmatic API
- Feature: Added --use-shell option (thanks to nidkil)
- Fix: Keep newline (
\n) characters intact when parsing env files - Change: Added node v10 and v12 to build automation
- Change: Updated Readme file to reflect new options and CLI changes
8.0.2
- Change: Updated dependencies and packages.json to fix
npm auditconcerns.
8.0.1
- Bug: Properly propagate child process exit signals and codes to parent process
8.0.0
- BREAKING: Stripe out spaces around the
keyandvaluein an env file. In order to include a beginning/ending space in an env var value, you need to surround the value in double or single quotes.ENV = " Value" - Bug: Fixed some bugs around how the parent process and spawn processes are killed
- Change: Updated a number of core libraries:
cross-spawn,coveralls,istanbul -> nyc,mocha,proxyquire,sinon,standard
7.0.0
- BREAKING: The
.envfile path resolving has been changed to allow for absolute pathing, relative pathing, and~home directory pathing. Please see Readme.md for more info about how the new pathing conventions work.
6.0.0
- BREAKING: Fallback to default
.envfile behavior is no longer the default behavior. You must specify--fallbackoption for that behavior now. - BREAKING: A specific node version has been set in package.json. Current minimum version is
>=4.0.0. Note: the implied minimum version before this release was always4.0.0, but now it is explicitly set and could produce warnings by npm if included in projects that utilizes a node version that is less than4.0.0. - Feature: Added
--fallbackoption to allow for falling back to the default.envfile if the provided.envfile is not found. - Feature: Added ability to select multiple environments from the
.env-cmdrcfile. The environments override each other like this:development,productionwhereproductionvars overridedevelopmentvars if they share the same vars. - Bug:
env-cmdno longer crashes when it cannot find the provided.envfile. Instead, it will execute as normal, but without included any custom env vars. Note: it will still include system and shell vars.
5.1.0
- Feature: Added new option
--no-overridethat when passed will make it so that the env file vars will not overwrite already defined env vars onprocess.envor in the shell - Updated Dev-Dependencies:
standard >= 10.0.0,sinon >= 2.0.0
5.0.0
- BREAKING: Inline comments are no longer allowed in
.envfiles (full line comments are still allowed) - BREAKING:
.envfile no longer supports theenv varformat (onlyenv=varis allowed now) - BREAKING: Double Quotes are no longer needed when using special symbols (such as
#) in the value portion of an env var - Feature: if the given env file cannot be found, it will auto default to searching
the execution directory for a file called
.envand use that as a fallback. See README for why this is helpful. (special thanks to Alexander Praetorius)
4.0.0
- BREAKING: In order to use double quotes as part of the env value, you must now surround those double quotes with an additional set of quotes: So
ENV1="value"->ENV1=""value""(this only applies to double quotes, single quotes continue to work as normal) - Bug: Fixed bug in the comment stripper function that would remove env values that included a
#. Now, in order to use a#in a env value, you have to surround that env value in double quotes:ENV="Some#Value". - Bug: Fixed a major bug with the
.env-cmdrcfile that would not add system env vars back in after reading the.env-cmdrcfile. This meant that system vars likePATHwould not exist when running the command.
3.0.0
- Feature: Added ability to use an
.env-cmdrcfile to hold multiple configs - Feature: Added ability to pass in a regular
.jsfile exporting an object for your env file (special thanks to Jon Scheiding!) - Change: Updated core
cross-spawnlib to 5.0.1
2.2.0
- Feature: Added support for .json env files (special thanks to Eric Lanehart!)
2.1.0
- Feature: Added support for
key valuemapping in env vars file - Feature: Added support for inline comments
ENV=VALUE # inline comment - Change: Will now ignore invalid lines in env vars file instead of throwing an error
- Change: Migrated all the parsing over to regex since the file format is simple enough right now to support that
- Bug: Removed old test cases for the
-e/--envflags that were not needed anymore
2.0.0
- BREAKING: Removed the
-eand--envflags. Now it just expects the first arg toenv-cmdto be the relative path to the env file:env-cmd env_file command carg1 carg2 - Change:
ParseEnvFileis now more properly namedParseEnvString - Feature:
ParseEnvStringwill ignore comment lines (lines starting with#) - Feature:
ParseEnvStringwill ignore empty lines in env file - Bug:
ParseEnvStringwill extract the last line even if no newline (\n) exists on it
1.0.1
- Fixed badges
- Added .npmignore
- Added help text to be printed out on certain errors
- Handled uncaught errors nicely
1.0.0
- Initial release