From 033942d30bef267cc363238ca797fee8a5b1ebe0 Mon Sep 17 00:00:00 2001 From: YuanSheng Wang Date: Mon, 9 Nov 2020 21:50:40 +0800 Subject: [PATCH] chore: exit if any error and specify the download file name when download by `wget`. (#751) fix #646 --- .gitignore | 2 ++ api/build-tools/schema-sync.sh | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a3b888657e..06ac7fe39f 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,5 @@ manager-api output default.etcd +api/build-tools/apisix +/*.zip diff --git a/api/build-tools/schema-sync.sh b/api/build-tools/schema-sync.sh index 830e19c9e3..7de361ccae 100755 --- a/api/build-tools/schema-sync.sh +++ b/api/build-tools/schema-sync.sh @@ -15,15 +15,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +set -ex + pwd=`pwd` version="master" if [[ -n $1 ]]; then version=$1 -fi +fi rm -rf ./api/build-tools/apisix/ -wget https://github.com/apache/apisix/archive/$version.zip +wget -O $version.zip https://github.com/apache/apisix/archive/$version.zip unzip $version.zip mkdir -p ./api/build-tools/apisix/ @@ -31,5 +34,5 @@ mv ./apisix-$version/apisix/* ./api/build-tools/apisix/ rm -rf ./apisix-$version cd ./api/build-tools/ && lua schema-sync.lua > ${pwd}/api/conf/schema.json -echo "sync success:" +echo "sync success:" echo "${pwd}/api/conf/schema.json"