@@ -6,19 +6,19 @@ Automatically keep `env.sample` files in sync with `.env`
66
77---
88
9- ` ess ` transforms environment files containing secrets (e.g. ` .env ` , ` .envrc ` ) into sample environment files (e.g.
9+ ` ess ` transforms environment files containing secrets (e.g. ` .env ` , ` .envrc ` ) into sample environment files (e.g.
1010` env.sample ` ) that may be safely checked into git.
1111
1212` ess ` may be run manually by running the cli executable, or automatically by installing the pre-commit hook with ` ess install `
13- in any git repository. Installing ` ess ` as a git hook ensures that project environment files are automatically and safely
14- revision controlled when they change.
13+ in any git repository. Installing ` ess ` as a git hook ensures that project environment files are automatically and safely
14+ revision controlled when they change.
1515
1616Doing so allows environment configurations to be shared across teams without leaking secrets.
1717
18- ## How it works
18+ ## How it works
1919
2020By default, ` ess ` checks the local directory for environment files named ` .env ` . The env file name is controlled by
21- the ` --env-file ` switch. Next, the environment file is parsed for environment variables. Environment variables
21+ the ` --env-file ` switch. Next, the environment file is parsed for environment variables. Environment variables
2222may be of the following forms:
2323
2424```
@@ -35,16 +35,16 @@ export FOO='bar baz'
3535
3636By default, variable values are replaced with innert values named after the variable, e.g. ` FOO=bar ` is replaced by ` FOO=<FOO> ` .
3737
38- Example values may be provided with the ` --example ` switch, e.g. ` --exmaple=FOO="enter your foo here" ` will set ` FOO ` 's
39- value as follows ` FOO="enter your foo here" ` in the sample file.
38+ Example values may be provided with the ` --example ` switch, e.g. ` --exmaple=FOO="enter your foo here" ` will set ` FOO ` 's
39+ value as follows ` FOO="enter your foo here" ` in the sample file.
4040
41- Finally, when all variables are replaced, the sample file is written with the sanitized variable values, along with all
41+ Finally, when all variables are replaced, the sample file is written with the sanitized variable values, along with all
4242non-variable strings from the file. By default the sample file is named ` env.sample ` , which is controlled by the ` --env-sample `
43- switch.
43+ switch.
4444
45- Because ` ess ` permits non-variable strings in environment files, it means that both comments and script code (in the case
46- of ` .envrc ` files) is included in environment sample files. This allows environment files to not only be checked into git, but
47- documented with comments.
45+ Because ` ess ` permits non-variable strings in environment files, it means that both comments and script code (in the case
46+ of ` .envrc ` files) is included in environment sample files. This allows environment files to not only be checked into git, but
47+ documented with comments.
4848
4949# Installation & Usage
5050
@@ -153,10 +153,10 @@ This utility can be used as a [pre-commit plugin](https://pre-commit.com/#instal
153153
154154## Add configuration
155155``` bash
156- cat << EOF > .pre-commit-config.yaml
156+ cat << EOF >.pre-commit-config.yaml
157157repos:
158158- repo: https://github.com/acaloiaro/ess.git
159- rev: v2.14.1
159+ rev: v2.16.4
160160 hooks:
161161 - id: ess
162162EOF
@@ -214,7 +214,7 @@ It's even possible to provide default/example values for every environment varia
214214``` yml
215215repos :
216216- repo : https://github.com/acaloiaro/ess.git
217- rev : v2.14.1
217+ rev : v2.16.4
218218 hooks :
219219 - id : ess
220220` ` `
@@ -224,7 +224,7 @@ repos:
224224` ` ` yml
225225repos:
226226- repo: https://github.com/acaloiaro/ess.git
227- rev: v2.14.1
227+ rev: v2.16.4
228228 hooks:
229229 - id: ess
230230 args: ['--env-file=.env_file', '--sample-file=env_file.sample']
@@ -239,7 +239,7 @@ environment variable name surrounded by `<brackets like this>` in sample files.
239239` ` ` yml
240240repos:
241241- repo: https://github.com/acaloiaro/ess.git
242- rev: v2.14.1
242+ rev: v2.16.4
243243 hooks:
244244 - id: ess
245245 args: [--example=FOO="Provide your foo here", --example=BAR="You can fetch bars from https://example.com/bars"]
@@ -258,4 +258,3 @@ Example sample file output
258258FOO=Provide your foo here
259259BAR=You can fetch bars from https://example.com/bars
260260```
261-
0 commit comments