Skip to content

Commit c571ab6

Browse files
committed
Improve Readme example with template
1 parent 2f3cc4a commit c571ab6

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Application Options:
6161

6262
### Example with golang templates
6363

64-
Configuration file `daemon.conf`:
64+
Configuration file `daemon.conf.tmpl`:
6565
```
6666
<VirtualHost ...>
6767
ServerName {{.Env.SERVERNAME}}
@@ -73,15 +73,24 @@ Configuration file `daemon.conf`:
7373
Process file with:
7474

7575
```bash
76-
SERVERNAME=www.foobar.example
77-
DOCUMENTROOT=/var/www/foobar.example/
78-
go-replace --mode=template daemon.conf
76+
export SERVERNAME=www.foobar.example
77+
export DOCUMENTROOT=/var/www/foobar.example/
78+
go-replace --mode=template --output-strip-ext=.tmpl daemon.conf.tmpl
79+
```
80+
81+
Reuslt file `daemon.conf`:
82+
```
83+
<VirtualHost ...>
84+
ServerName www.foobar.example
85+
DocumentRoot /var/www/foobar.example/
86+
<VirtualHost>
87+
7988
```
8089

8190
## Installation
8291

8392
```bash
84-
GOREPLACE_VERSION=0.5.4 \
93+
GOREPLACE_VERSION=0.6.0 \
8594
&& wget -O /usr/local/bin/go-replace https://github.com/webdevops/goreplace/releases/download/$GOREPLACE_VERSION/gr-64-linux \
8695
&& chmod +x /usr/local/bin/go-replace
8796
```

0 commit comments

Comments
 (0)