Skip to content

Commit

Permalink
Update docs for the bin command.
Browse files Browse the repository at this point in the history
  • Loading branch information
joho committed Oct 11, 2014
1 parent d2ce5be commit a01a834
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@ From the original Library:
>
> But it is not always practical to set environment variables on development machines or continuous integration servers where multiple projects are run. Dotenv load variables from a .env file into ENV when the environment is bootstrapped.
It can be used as a library (for loading in env for your own daemons etc) or as a bin command.

There is test coverage and CI for both linuxish and windows environments, but I make no guarantees about the bin version working on windows.

## Installation

As a library

```shell
go get github.com/joho/godotenv
```

or if you want to use it as a bin command
```shell
go get github.com/joho/godotenv/cmd/godotenv
```

## Usage

Add your application configuration to your `.env` file in the root of your project:
Expand Down Expand Up @@ -85,7 +96,15 @@ myEnv, err := godotenv.Read()
s3Bucket := myEnv["S3_BUCKET"]
```

end
### Command Mode

Assuming you've installed the command as above and you've got `$GOPATH/bin` in your `$PATH`

```
godotenv -f /some/path/to/.env some_command with some args
```

If you don't specify `-f` it will fall back on the default of loading `.env` in `PWD`

## Contributing

Expand Down

0 comments on commit a01a834

Please sign in to comment.