From 6c6a694668f4c6f10582f61013b4131bf92f2fee Mon Sep 17 00:00:00 2001 From: Deshi Xiao Date: Tue, 17 May 2016 14:18:05 +0800 Subject: [PATCH] Fix: sed compatible with mac os env sed -i need explicit extention on mac, but linux is optinoal. so for developer need a compatible request on macos --- docs/prepare-swagger.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/prepare-swagger.sh b/docs/prepare-swagger.sh index dee9b2e9b..742d07fdb 100755 --- a/docs/prepare-swagger.sh +++ b/docs/prepare-swagger.sh @@ -9,10 +9,10 @@ wget https://github.com/swagger-api/swagger-ui/archive/v2.1.4.tar.gz -O swagger. echo "Untarring Swagger UI package to the static file path..." tar -C ../static/vendors -zxf swagger.tar.gz swagger-ui-2.1.4/dist echo "Executing some processes..." -sed -i 's/http:\/\/petstore\.swagger\.io\/v2\/swagger\.json/'$SCHEME':\/\/'$SERVER_IP'\/static\/resources\/yaml\/swagger\.yaml/g' \ - ../static/vendors/swagger-ui-2.1.4/dist/index.html +sed -i.bak 's/http:\/\/petstore\.swagger\.io\/v2\/swagger\.json/'$SCHEME':\/\/'$SERVER_IP'\/static\/resources\/yaml\/swagger\.yaml/g' \ +../static/vendors/swagger-ui-2.1.4/dist/index.html mkdir -p ../static/resources/yaml cp swagger.yaml ../static/resources/yaml -sed -i 's/host: localhost/host: '$SERVER_IP'/g' ../static/resources/yaml/swagger.yaml -sed -i 's/ \- http$/ \- '$SCHEME'/g' ../static/resources/yaml/swagger.yaml +sed -i.bak 's/host: localhost/host: '$SERVER_IP'/g' ../static/resources/yaml/swagger.yaml +sed -i.bak 's/ \- http$/ \- '$SCHEME'/g' ../static/resources/yaml/swagger.yaml echo "Finish preparation for the Swagger UI."