File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ go-replace --mode=template daemon.conf
7979## Installation
8080
8181``` bash
82- GOREPLACE_VERSION=0.5.1 \
82+ GOREPLACE_VERSION=0.5.2 \
8383&& wget -O /usr/local/bin/go-replace https://github.com/webdevops/goreplace/releases/download/$GOREPLACE_VERSION /gr-64-linux \
8484&& chmod +x /usr/local/bin/go-replace
8585```
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import (
1717
1818const (
1919 Author = "webdevops.io"
20- Version = "0.5.1 "
20+ Version = "0.5.2 "
2121)
2222
2323type changeset struct {
@@ -431,7 +431,11 @@ func generateTemplateData(changesets []changeset) (templateData) {
431431 // add env variables
432432 for _ , e := range os .Environ () {
433433 pair := strings .Split (e , "=" )
434- ret .Env [pair [0 ]] = pair [1 ]
434+
435+ envKey := pair [0 ]
436+ envValue := strings .Join (pair [1 :], "=" )
437+
438+ ret .Env [envKey ] = envValue
435439 }
436440
437441 return ret
Original file line number Diff line number Diff line change @@ -417,6 +417,27 @@ Testing template mode with only env and empty var:
417417 this is the last line
418418
419419
420+ Testing template mode with only env and empty var:
421+
422+ $ cat > test.txt <<EOF
423+ > {{23 -}} < {{- 45}}
424+ > {{.Env.Foobar}}
425+ > this is a testline
426+ > this is the second line
427+ > this is the third foobar line
428+ > this is the last line
429+ > EOF
430+ $ Foobar="bar=foo" goreplace --mode=template test.txt
431+ $ cat test.txt
432+ 23<45
433+ bar=foo
434+ this is a testline
435+ this is the second line
436+ this is the third foobar line
437+ this is the last line
438+
439+
440+
420441Testing template mode:
421442
422443 $ cat > test.txt <<EOF
You can’t perform that action at this time.
0 commit comments