A cross-platform tool to load a .env and run a command. https://webinstall.dev/dotenv
Go to file
AJ ONeal 0e7e7179f6 fix quote typo 2020-10-19 23:22:11 -06:00
internal/tools update README, add go-gitver for manual build versions 2020-10-19 17:59:14 -06:00
vendor vendor deps 2020-10-19 17:59:25 -06:00
.gitignore initial release 2020-10-19 17:37:54 -06:00
.goreleaser.example.yml initial release 2020-10-19 17:37:54 -06:00
AUTHORS initial release 2020-10-19 17:37:54 -06:00
LICENSE initial release 2020-10-19 17:37:54 -06:00
README.md fix quote typo 2020-10-19 23:22:11 -06:00
go.mod update README, add go-gitver for manual build versions 2020-10-19 17:59:14 -06:00
go.sum update README, add go-gitver for manual build versions 2020-10-19 17:59:14 -06:00
main.go fix quote typo 2020-10-19 23:22:11 -06:00

README.md

dotenv

A cross-platform tool to run a command with environment variables loaded from a given .env file.

Example:

dotenv -f .env -- node server.js

Install

Mac, Linux:

curl -sS https://webinstall.dev/dotenv | bash

Windows 10:

curl -A MS https://webinstall.dev/dotenv | powershell

Usage

dotenv v1.0.0 (17c7677) 2020-10-19T23:43:57Z

Usage:
    dotenv [-f .env.alternate] -- <command> [arguments...]

  -f string
    	path to .env file (default ".env")
  --help
    	print usage and exit
  --version
    	print version and exit

Example:
    dotenv -f .env -- caddy run --config Caddyfile

Build

dotenv is written in Go, using github.com/joho/godotenv.

Install Go:

curl -sS https://webinstall.dev/golang | bash

(see https://webinstall.dev/golang for details)

Manually

export GOFLAGS="-mod=vendor"
go generate -mod=vendor ./...
go run -mod=vendor git.rootprojects.org/root/go-gitver/v2
go build -mod=vendor .
./dotenv --version

With GoReleaser

Install GoReleaser:

curl -sS https://webinstall.dev/goreleaser | bash
goreleaser --snapshot --skip-publish --rm-dist
./dist/dotenv_darwin_amd64/dotenv --version

License

Copyright 2020 The dotenv Authors.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.