From 6d4ad82262ffb614b1f0c4700df7f1b7f54bb33c Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Sun, 7 Oct 2018 22:26:15 +0200 Subject: [PATCH] use 'sed -i.bak' instead of 'sed -i' to make it compatible with macos sed --- .gitignore | 3 +++ examples/configGeneration.md | 2 +- examples/helloWorld/README.md | 8 +------- examples/mySql/README.md | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 73dba7766..435ac8b8f 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/examples/configGeneration.md b/examples/configGeneration.md index 2e3821a2f..272d030a0 100644 --- a/examples/configGeneration.md +++ b/examples/configGeneration.md @@ -164,7 +164,7 @@ the server will use: ``` -sed -i 's/pineapple/kiwi/' $OVERLAYS/staging/map.yaml +sed -i.bak 's/pineapple/kiwi/' $OVERLAYS/staging/map.yaml ``` See the new greeting: diff --git a/examples/helloWorld/README.md b/examples/helloWorld/README.md index 0a6d3257e..a812ad9a2 100644 --- a/examples/helloWorld/README.md +++ b/examples/helloWorld/README.md @@ -108,16 +108,10 @@ label_ applied to all resources: ``` -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: ``` diff --git a/examples/mySql/README.md b/examples/mySql/README.md index c5b72a07c..da5c556ef 100644 --- a/examples/mySql/README.md +++ b/examples/mySql/README.md @@ -136,7 +136,7 @@ a label, but one can always edit `kustomization.yaml` directly: ``` -sed -i 's/app: helloworld/app: prod/' \ +sed -i.bak 's/app: helloworld/app: prod/' \ $DEMO_HOME/kustomization.yaml ```