build: Fix sed command failure in Mac OS. (#4253)

apidoc build failed in Mac OS because of sed in-place command. It is a minor change that fixed this issue. More information here

Fixes: #3247
Fixes: #3312
This commit is contained in:
Sina Kashipazha 2020-08-10 09:41:45 +02:00 committed by GitHub
parent cd8e28b279
commit ce7a32c51d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -56,13 +56,23 @@ then
exit 1
fi
# Default case for Linux sed, just use "-i"
sedi='-i'
case "$(uname)" in
# For macOS, use two parameters
Darwin*) sedi='-i ""'
esac
# Expand the parameters in the actual call to "sed"
sed -e 's/foo/bar/' target.file
set -e
(cd "$DISTDIR/xmldoc"
cp "$thisdir"/*.java .
cp "$thisdir"/*.xsl .
sed -e 's,%API_HEADER%,All APIs,g' "$thisdir/generatetoc_header.xsl" >generatetoc.xsl
sed -i "s/%ACS_RELEASE%/${ACS_RELEASE}/g" generatetoc.xsl
sed -i "s/%ACS_RELEASE%/${ACS_RELEASE}/g" generatecommands.xsl
sed $sedi "s/%ACS_RELEASE%/${ACS_RELEASE}/g" generatetoc.xsl
sed $sedi "s/%ACS_RELEASE%/${ACS_RELEASE}/g" generatecommands.xsl
PLATFORM=`uname -s`
if [[ "$PLATFORM" =~ .*WIN.* ]]