@@ -6,19 +6,19 @@ Automatically keep `env.sample` files in sync with `.env`
6
6
7
7
---
8
8
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.
10
10
` env.sample ` ) that may be safely checked into git.
11
11
12
12
` 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.
15
15
16
16
Doing so allows environment configurations to be shared across teams without leaking secrets.
17
17
18
- ## How it works
18
+ ## How it works
19
19
20
20
By 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
22
22
may be of the following forms:
23
23
24
24
```
@@ -35,16 +35,16 @@ export FOO='bar baz'
35
35
36
36
By default, variable values are replaced with innert values named after the variable, e.g. ` FOO=bar ` is replaced by ` FOO=<FOO> ` .
37
37
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.
40
40
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
42
42
non-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.
44
44
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.
48
48
49
49
# Installation & Usage
50
50
@@ -153,10 +153,10 @@ This utility can be used as a [pre-commit plugin](https://pre-commit.com/#instal
153
153
154
154
## Add configuration
155
155
``` bash
156
- cat << EOF > .pre-commit-config.yaml
156
+ cat << EOF >.pre-commit-config.yaml
157
157
repos:
158
158
- repo: https://github.com/acaloiaro/ess.git
159
- rev: v2.14.1
159
+ rev: v2.17.0
160
160
hooks:
161
161
- id: ess
162
162
EOF
@@ -214,7 +214,7 @@ It's even possible to provide default/example values for every environment varia
214
214
``` yml
215
215
repos :
216
216
- repo : https://github.com/acaloiaro/ess.git
217
- rev : v2.14.1
217
+ rev : v2.17.0
218
218
hooks :
219
219
- id : ess
220
220
` ` `
@@ -224,7 +224,7 @@ repos:
224
224
` ` ` yml
225
225
repos:
226
226
- repo: https://github.com/acaloiaro/ess.git
227
- rev: v2.14.1
227
+ rev: v2.17.0
228
228
hooks:
229
229
- id: ess
230
230
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.
239
239
` ` ` yml
240
240
repos:
241
241
- repo: https://github.com/acaloiaro/ess.git
242
- rev: v2.14.1
242
+ rev: v2.17.0
243
243
hooks:
244
244
- id: ess
245
245
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
258
258
FOO=Provide your foo here
259
259
BAR=You can fetch bars from https://example.com/bars
260
260
```
261
-
0 commit comments