Skip to content

Commit

Permalink
[CI:DOCS] Making docs build on mac
Browse files Browse the repository at this point in the history
sed syntax on mac is different

Signed-off-by: Ashley Cui <[email protected]>
  • Loading branch information
ashley-cui committed Aug 26, 2020
1 parent 8fdc116 commit 7e00475
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions docs/remote-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,31 @@ 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
local remote=$(echo $TARGET/podman-remote.*)
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
Expand Down

0 comments on commit 7e00475

Please sign in to comment.