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
79
79
## Installation
80
80
81
81
``` bash
82
- GOREPLACE_VERSION=0.5.1 \
82
+ GOREPLACE_VERSION=0.5.2 \
83
83
&& wget -O /usr/local/bin/go-replace https://github.com/webdevops/goreplace/releases/download/$GOREPLACE_VERSION /gr-64-linux \
84
84
&& chmod +x /usr/local/bin/go-replace
85
85
```
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import (
17
17
18
18
const (
19
19
Author = "webdevops.io"
20
- Version = "0.5.1 "
20
+ Version = "0.5.2 "
21
21
)
22
22
23
23
type changeset struct {
@@ -431,7 +431,11 @@ func generateTemplateData(changesets []changeset) (templateData) {
431
431
// add env variables
432
432
for _ , e := range os .Environ () {
433
433
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
435
439
}
436
440
437
441
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:
417
417
this is the last line
418
418
419
419
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
+
420
441
Testing template mode:
421
442
422
443
$ cat > test.txt <<EOF
You can’t perform that action at this time.
0 commit comments