Releases: patrickdappollonio/dotenv
v2.0.3
TL;DR
A user reported some, often required, environment variables might've been missing on strict mode executions. To support a wide range of processes, strict mode should ensure no extra variables are given to the program while still keeping some baseline variables still around.
This release automatically adds the following environment variables as passthrough even if strict
mode is set: PATH
, HOME
, SHELL
, USER
, SHLVL
, LANG
, TERM
, LOGNAME
, PWD
, OLDPWD
, EDITOR
, VISUAL
, DISPLAY
and HOSTNAME
. Thanks @cbmdfc for the report!
What's Changed
- Add additional environment variables. Fixes #12 by @patrickdappollonio in #13
- Unparallelize tests. by @patrickdappollonio in #14
Full Changelog: v2.0.2...v2.0.3
v2.0.2 - Quoted parameters fix
Quick TL;DR
We've had an issue here since version 1.0 that prevented us from adding quoted parameters to an environment variable file. Quotes should be harmless so this adds support for removing them before submitting them to the job. This does not unescape quotes within quotes.
This change also makes Linux to always have static builds by default.
What's Changed
- Make static Linux builds the default. by @patrickdappollonio in #9
- Test cross compilation on commits to main branch by @patrickdappollonio in #10
- Fix quoted parameters on env file. by @patrickdappollonio in #11
Full Changelog: v2.0.1...v2.0.2
v2.0.1 - Statically compiled binaries for Linux
Static binaries for Linux
This release changes nothing from a feature perspective other than providing with a Linux binary with no dependencies (a la Go). By default, dotenv
relies on libc
. Files in the release that include the name -static-
will be completely static binaries with zero dependencies (but with a tiny bit higher binary size).
The next version will ditch completely the dynamically linked binaries for Linux in favor of the static versions.
What's Changed
- Add support for dependabot. by @patrickdappollonio in #3
- Bump actions/checkout from 2 to 4 by @dependabot in #4
- Add FreeBSD target support and static compilation via Linux MUSL by @patrickdappollonio in #6
- Add support for static binary for Linux. by @patrickdappollonio in #7
- Remove FreeBSD build target. by @patrickdappollonio in #8
New Contributors
- @dependabot made their first contribution in #4
Full Changelog: v2.0.0...v2.0.1
v2.0.0 - dotenv reloaded!
Welcome to the new release of dotenv
!
A new update after 5 years of hiatus 😆 This release allowed me to optimize what the program does and how correctly it manages certain situations.
The biggest callout is that the program has been rewritten in Rust. There was honestly nothing wrong with Go besides the binary size which could get quite bloated. In version 1.0, I wrote a quick-and-dirty flag parser which I would've probably changed now to pflag
or even cobra
, but that would've increased the binary size considerably. Maintainability-wise, the code was good, but could've been better.
Now, with the program written in Rust, the binary size after compilation, on Linux, sits right under a megabyte (824K to be precise)
Bug fixing
One major bug that went unreported for 5 years but I had people report it to me directly was the fact that flags for dotenv
conflicted with flags on the command being executed by dotenv
. Imagine dotenv
1.0 supported setting strict mode with --strict
and you want to create a new Angular app with their ng
CLI, what happens if you run this?
dotenv --strict ng new example-app-name --strict
Who gets the --strict
flag? dotenv
? ng
? Both? What if you want one in particular to get that value? It was not possible in version 1.0 to specify a flag both to dotenv
and the child subcommand.
This has now been fixed. If you are just running commands with no command-line flag arguments (those with -
or --
before the flag or keyword) at all, the following execution would still work as before:
dotenv --strict ng new example-app-name
But now, if you want to specify flags for the subcommands being executed, like multiple other CLIs, you must separate your command from dotenv
by using double dashes:
dotenv --strict -- ng new example-app-name --strict
In this case both dotenv
and ng
get the flag --strict
. If you were to just give that setting to dotenv
but not to ng
you just have to remove it from the side that doesn't need it:
dotenv --strict -- ng new example-app-name
Dropped features
A feature we're dropping completely was also the source of some strange bugs: DOTENV_COMMAND
in the .env
files allowed you, in version 1.0.0, to configure a custom command so something like this that would normally stutter would not stutter anymore:
dotenv-v1 -e kubectl kubectl get pods
You could remove one of the kubectl
words if you set DOTENV_COMMAND
in the .env
file to be kubectl
:
$ cat ~/.dotenv/kubectl.env
DOTENV_COMMAND=kubectl
$ dotenv-v1 -e kubectl get pods
# command output
While it's a nice feature, most users I saw in the wild used aliases to interact with their programs, not dotenv
directly. So we're dropping that feature for the time being. If you used to rely on it, please let me know by opening an issue and I would be happy to bring it back with appropriate care.
What's Changed
- Rewrite version 2.0 to Rust by @patrickdappollonio in #2
Full Changelog: v1.0.0...v2.0.0
v1.0.0
The first version of dotenv
is here! Get your Linux or Darwin binaries, place them on your $PATH
-- any folder in your $PATH
works! -- and start dotenv
ing right away! (Well, you might have to rename the binaries from dotenv_$os
to simply dotenv
, then bash away!)