Skip to content

Commit

Permalink
Merge pull request #7457 from ashley-cui/macdocs
Browse files Browse the repository at this point in the history
[CI:DOCS] Making docs build on mac
  • Loading branch information
rhatdan authored Aug 27, 2020
2 parents d6b0377 + 7e00475 commit 7d3cadc
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 7d3cadc

Please sign in to comment.