envrun

command module
v0.0.0-...-f5d3bcd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 10 Imported by: 0

README

envrun

The envrun command allows running any command with default environment variables taken from a file, copying its standard error and standard output to its own standard error and standard output.

Variables already present in the environment override the one in the file.

The command may have arguments, and it will be looked up in the $PATH if its name does not contain a /.

Installing

Install from source, using a Go SDK: go install github.com/fgm/envrun@latest

Running

Examples
  • envrun foo: run foo with the environment defaults loaded from .env if it exists, or fail if it cannot be read.
  • envrun -f .env.demo env: run the env command with the environment defaults loaded from .env.demo or fail if it cannot be read
Exit status
  • If the command exits, envrun will return its exit status
  • If the command is killed, envrun will return exit status 1

Why ?

Many programs support reading their environment from a .env file, and many IDEs support that feature in run configurations.

This command is provided for situations outside an IDE (e.g. CI/CD) and where the program to be run does not include this feature.

Support

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL