diff options
author | Ashley Cui <acui@redhat.com> | 2020-08-26 09:01:55 -0400 |
---|---|---|
committer | Ashley Cui <acui@redhat.com> | 2020-08-27 15:00:35 -0400 |
commit | b0d4f087439925b1c01a7d728232402ae8357538 (patch) | |
tree | ed7f1c7e43626ceaaee7541b8658f273965fae74 | |
parent | 9c8e0a0f2568d42aec47dd36103713f47ba4c0f2 (diff) | |
download | podman-b0d4f087439925b1c01a7d728232402ae8357538.tar.gz podman-b0d4f087439925b1c01a7d728232402ae8357538.tar.bz2 podman-b0d4f087439925b1c01a7d728232402ae8357538.zip |
[CI:DOCS] Making docs build on mac
sed syntax on mac is different
Signed-off-by: Ashley Cui <acui@redhat.com>
-rwxr-xr-x | docs/remote-docs.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/docs/remote-docs.sh b/docs/remote-docs.sh index 4774b94a3..a9278c95d 100755 --- a/docs/remote-docs.sh +++ b/docs/remote-docs.sh @@ -87,6 +87,16 @@ function pub_pages() { done } +## sed syntax is different on darwin and linux +## sed --help fails on mac, meaning we have to use mac syntax +function sed_os(){ + if sed --help > /dev/null 2>&1 ; then + $(sed -i "$@") + else + $(sed -i "" "$@") + fi +} + ## rename renames podman-remote.ext to podman.ext, and fixes up contents to reflect change function rename (){ if [[ "$PLATFORM" != linux ]]; then @@ -94,14 +104,14 @@ function rename (){ local ext=${remote##*.} mv $remote $TARGET/podman.$ext - $(sed -i "s/podman\\\*-remote/podman/g" $TARGET/podman.$ext) - $(sed -i "s/A\ remote\ CLI\ for\ Podman\:\ //g" $TARGET/podman.$ext) + sed_os "s/podman\\\*-remote/podman/g" $TARGET/podman.$ext + sed_os "s/A\ remote\ CLI\ for\ Podman\:\ //g" $TARGET/podman.$ext case $PLATFORM in darwin|linux) - $(sed -i "s/Podman\\\*-remote/Podman\ for\ Mac/g" $TARGET/podman.$ext) + sed_os "s/Podman\\\*-remote/Podman\ for\ Mac/g" $TARGET/podman.$ext ;; windows) - $(sed -i "s/Podman\\\*-remote/Podman\ for\ Windows/g" $TARGET/podman.$ext) + sed_os "s/Podman\\\*-remote/Podman\ for\ Windows/g" $TARGET/podman.$ext ;; esac fi |