diff --git a/api/export-doc.sh b/api/export-doc.sh index f7a12869722..fd40a85d5e9 100755 --- a/api/export-doc.sh +++ b/api/export-doc.sh @@ -15,15 +15,20 @@ cp v1/README.md $TMP_FILE # cleanup the generated documentation for the website # remove the link to the top of the page -sed -i '/
Top<\/a><\/p>/d' $TMP_FILE
-sed -i '/<\/a>/d' $TMP_FILE
+sed -i'' -e '/ Top<\/a><\/p>/d' $TMP_FILE
+sed -i'' -e '/<\/a>/d' $TMP_FILE
# remove title
-sed -i '/^# Protocol Documentation/d' $TMP_FILE
+sed -i'' -e '/^# Protocol Documentation/d' $TMP_FILE
# remove table of content
-sed -i -e '/## Table of Contents/,/##/{//!d}' $TMP_FILE
-sed -i '/^## Table of Contents/d' $TMP_FILE
+sed -i'' -e '/## Table of Contents/,/##/{//!d;}' $TMP_FILE
+sed -i'' -e '/^## Table of Contents/d' $TMP_FILE
# cleanup unecessary consecutive whitelines
-sed -i '/^[[:space:]]*$/N;/^[[:space:]]*\n[[:space:]]*$/D' $TMP_FILE
+sed -i'' -e '/^[[:space:]]*$/N;/^[[:space:]]*\n[[:space:]]*$/D' $TMP_FILE
+# remove empty line at the end of the file (required for macOS, doesn't harm on Linux)
+sed -i'' -e '${/^$/d;}' $TMP_FILE
+
+# Cleanup backup file that might be created by macOS sed:
+rm ${TMP_FILE}-e 2>/dev/null || true
# add a frontmatter and a small introduction
echo '---
@@ -42,4 +47,3 @@ The Tetragon API is an independant Go module that can be found in the Tetragon
repository under [api](https://github.com/cilium/tetragon/tree/main/api). The
version 1 of this API is defined in
[github.com/cilium/tetragon/api/v1/tetragon](https://github.com/cilium/tetragon/tree/main/api/v1/tetragon).' | cat - $TMP_FILE > $1
-
diff --git a/docs/content/en/docs/reference/grpc-api.md b/docs/content/en/docs/reference/grpc-api.md
index 07d0cfe8a79..cd04926af28 100644
--- a/docs/content/en/docs/reference/grpc-api.md
+++ b/docs/content/en/docs/reference/grpc-api.md
@@ -975,4 +975,3 @@ Determins the behaviour of a field filter
| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |
-
diff --git a/docs/content/en/docs/reference/helm-chart.md b/docs/content/en/docs/reference/helm-chart.md
index d24f4f04658..83b30abd6cd 100644
--- a/docs/content/en/docs/reference/helm-chart.md
+++ b/docs/content/en/docs/reference/helm-chart.md
@@ -8,7 +8,7 @@ This page was generated with github.io/cilium/tetragon/install/kubernetes/export
please do not edit directly.
{{< /comment >}}
-The Tetragon Helm chart source is available under
+The Tetragon Helm chart source is available under
[github.io/cilium/tetragon/install/kubernetes](https://github.com/cilium/tetragon/tree/main/install/kubernetes)
and is distributed from the Cilium helm charts repository [helm.cilium.io](https://helm.cilium.io).
@@ -107,4 +107,3 @@ To use [the values available](#values), with `helm install` or `helm upgrade`, u
| tetragonOperator.skipCRDCreation | bool | `false` | |
| tolerations[0].operator | string | `"Exists"` | |
| updateStrategy | object | `{}` | |
-
diff --git a/install/kubernetes/export-doc.sh b/install/kubernetes/export-doc.sh
index 6660c4a7a04..64d545ea23e 100755
--- a/install/kubernetes/export-doc.sh
+++ b/install/kubernetes/export-doc.sh
@@ -15,18 +15,22 @@ cp README.md $TMP_FILE
# cleanup the generated documentation for the website
# remove the title
-sed -i '/^# tetragon$/d' $TMP_FILE
+sed -i'' -e '/^# tetragon$/d' $TMP_FILE
# remove the badges
-sed -i '/^\!\[Version:/d' $TMP_FILE
+sed -i'' -e '/^\!\[Version:/d' $TMP_FILE
# remove the "Helm chart for Tetragon mention"
-sed -i '/^Helm chart for Tetragon$/d' $TMP_FILE
+sed -i'' -e '/^Helm chart for Tetragon$/d' $TMP_FILE
# remove unnecessary line
-sed -i '/^----------------------------------------------$/d' $TMP_FILE
+sed -i'' -e '/^----------------------------------------------$/d' $TMP_FILE
# remove autogenerated copyright
-sed -i '/^Autogenerated from chart metadata using \[helm-docs /d' $TMP_FILE
+sed -i'' -e '/^Autogenerated from chart metadata using \[helm-docs /d' $TMP_FILE
# cleanup unecessary consecutive whitelines
-sed -i '/^[[:space:]]*$/N;/^[[:space:]]*\n[[:space:]]*$/D' $TMP_FILE
+sed -i'' -e '/^[[:space:]]*$/N;/^[[:space:]]*\n[[:space:]]*$/D' $TMP_FILE
+# remove empty line at the end of the file (required for macOS, doesn't harm on Linux)
+sed -i'' -e '${/^$/d;}' $TMP_FILE
+# Cleanup backup file that might be created by macOS sed:
+rm ${TMP_FILE}-e 2>/dev/null || true
# add a frontmatter and a small introduction
echo '---
@@ -39,7 +43,7 @@ This page was generated with github.io/cilium/tetragon/install/kubernetes/export
please do not edit directly.
{{< /comment >}}
-The Tetragon Helm chart source is available under
+The Tetragon Helm chart source is available under
[github.io/cilium/tetragon/install/kubernetes](https://github.com/cilium/tetragon/tree/main/install/kubernetes)
and is distributed from the Cilium helm charts repository [helm.cilium.io](https://helm.cilium.io).
@@ -51,4 +55,3 @@ helm install tetragon cilium/tetragon -n kube-system
```
To use [the values available](#values), with `helm install` or `helm upgrade`, use `--set key=value`.' | cat - $TMP_FILE > $1
-