define_env 0.1.1 define_env: ^0.1.1 copied to clipboard
Load environment variables from a `.env` file and converts it into a dart-define string. You can optionally copy the config to VS Code or to the clipboard.
define_env #
Load environment variables from a .env
file and converts it into a dart-define string. You can
optionally copy the config to VS Code or to the clipboard.
Usage #
Get the latest version from pub:
$ dart pub global activate define_env
$ dart pub global run define_env # generate dart define string and print it to stdout
You can skip printing using the --no-print
flag
Copy to clipboard
$ dart pub global run define_env -c # generate dart define string and copy to clipboard
Copy to VS Code launch.json
$ dart pub global run define_env -l # generate dart define string and copy it to launch.json
By default, all configurations in launch.json
are updated. If you want to update only a specific
configuration, you can do the following
$ dart pub global run define_env -l -n staging # generate dart define string and copy it to "staging" configuration in launch.json
Note
launch.json
may sometimes contain comments. These comments cannot be preserved as of now. If this is important then you should avoid this package- When copying to
launch.json
, define_env tries to preserve existing arguments and overwrites only the dart-define statements. This is not thoroughly tested and if you face problems with additional arguments please create an issue.
Discussion #
Use the issue tracker for bug reports and feature requests.
Roadmap #
- Add support for Android Studio and Intellij
- Copy config name directly from
.env
files. ex.env.staging
is copied to staging config - Add validation support against
.env.example
to see warn if any environment variable is missing - Simplify command usage. ex
define_env:print
define_env:copy
define_env:vscode
etc