use 'sed -i.bak' instead of 'sed -i' to make it compatible with macos sed

This commit is contained in:
David Schweikert
2018-10-07 22:26:15 +02:00
parent 489f6e2e67
commit 6d4ad82262
4 changed files with 6 additions and 9 deletions

3
.gitignore vendored
View File

@@ -11,3 +11,6 @@ kustomize
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# We use sed -i.bak when doing in-line replace, because it works better cross-platform
.bak

View File

@@ -164,7 +164,7 @@ the server will use:
<!-- @changeMap @test -->
```
sed -i 's/pineapple/kiwi/' $OVERLAYS/staging/map.yaml
sed -i.bak 's/pineapple/kiwi/' $OVERLAYS/staging/map.yaml
```
See the new greeting:

View File

@@ -108,16 +108,10 @@ label_ applied to all resources:
<!-- @addLabel @test -->
```
sed -i 's/app: hello/app: my-hello/' \
sed -i.bak 's/app: hello/app: my-hello/' \
$BASE/kustomization.yaml
```
On a Mac, use:
```
sed -i '' $pattern $file
```
to get in-place editing.
See the effect:
<!-- @checkLabel @test -->
```

View File

@@ -136,7 +136,7 @@ a label, but one can always edit `kustomization.yaml` directly:
<!-- @customizeLabels @test -->
```
sed -i 's/app: helloworld/app: prod/' \
sed -i.bak 's/app: helloworld/app: prod/' \
$DEMO_HOME/kustomization.yaml
```