From 0c405e4b519ec2694d6577ea197214579f737943 Mon Sep 17 00:00:00 2001 From: Nex Date: Sat, 7 Mar 2020 13:53:11 +0800 Subject: [PATCH] Update scripts --- gen-go.bat | 3 ++- gen-go.sh | 14 ++++++++------ gen-web.bat | 3 ++- gen-web.sh | 3 ++- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gen-go.bat b/gen-go.bat index ef0fa5c..68e633f 100644 --- a/gen-go.bat +++ b/gen-go.bat @@ -1,4 +1,5 @@ @echo off +cd /d "%~dp0" set dir=.\gen\go set exe=protoc set gen=protoc-gen-go @@ -11,8 +12,8 @@ where /q %gen% || echo missing %gen% && exit /B if not exist %dir% mkdir %dir% %exe% -I . --go_out=plugins=grpc:%dir% bdledger/api/common.proto %exe% -I . --go_out=plugins=grpc:%dir% bdledger/api/error_details.proto +%exe% -I . --go_out=plugins=grpc:%dir% bdledger/api/node.proto %exe% -I . --go_out=plugins=grpc:%dir% bdledger/api/ledger.proto %exe% -I . --go_out=plugins=grpc:%dir% bdledger/api/query.proto -%exe% -I . --go_out=plugins=grpc:%dir% bdledger/api/node.proto echo all done diff --git a/gen-go.sh b/gen-go.sh index 617ffc7..e619eef 100644 --- a/gen-go.sh +++ b/gen-go.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash -mkdir -p gen/go -protoc -I . --go_out=plugins=grpc:gen/go bdledger/api/common.proto -protoc -I . --go_out=plugins=grpc:gen/go bdledger/api/error_details.proto -protoc -I . --go_out=plugins=grpc:gen/go bdledger/api/ledger.proto -protoc -I . --go_out=plugins=grpc:gen/go bdledger/api/query.proto -protoc -I . --go_out=plugins=grpc:gen/go bdledger/api/node.proto +cd "${0%/*}" +dir=gen/go +mkdir -p $dir +protoc -I . --go_out=plugins=grpc:$dir bdledger/api/common.proto +protoc -I . --go_out=plugins=grpc:$dir bdledger/api/error_details.proto +protoc -I . --go_out=plugins=grpc:$dir bdledger/api/node.proto +protoc -I . --go_out=plugins=grpc:$dir bdledger/api/ledger.proto +protoc -I . --go_out=plugins=grpc:$dir bdledger/api/query.proto diff --git a/gen-web.bat b/gen-web.bat index 4329193..71f4b85 100644 --- a/gen-web.bat +++ b/gen-web.bat @@ -1,4 +1,5 @@ @echo off +cd /d "%~dp0" set dir=.\gen\web set exe=protoc set gen=protoc-protoc-gen-grpc-web @@ -9,8 +10,8 @@ where /q %gen% || echo missing %gen% && exit /B if not exist %dir% mkdir %dir% %exe% -I . --js_out=import_style=commonjs:%dir% --grpc-web_out=import_style=commonjs,mode=grpcwebtext:%dir% bdledger/api/common.proto %exe% -I . --js_out=import_style=commonjs:%dir% --grpc-web_out=import_style=commonjs,mode=grpcwebtext:%dir% bdledger/api/error_details.proto +%exe% -I . --js_out=import_style=commonjs:%dir% --grpc-web_out=import_style=commonjs,mode=grpcwebtext:%dir% bdledger/api/node.proto %exe% -I . --js_out=import_style=commonjs:%dir% --grpc-web_out=import_style=commonjs,mode=grpcwebtext:%dir% bdledger/api/ledger.proto %exe% -I . --js_out=import_style=commonjs:%dir% --grpc-web_out=import_style=commonjs,mode=grpcwebtext:%dir% bdledger/api/query.proto -%exe% -I . --js_out=import_style=commonjs:%dir% --grpc-web_out=import_style=commonjs,mode=grpcwebtext:%dir% bdledger/api/node.proto echo all done diff --git a/gen-web.sh b/gen-web.sh index 0a07ce3..5fdebba 100644 --- a/gen-web.sh +++ b/gen-web.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash +cd "${0%/*}" dir=gen/web mkdir -p $dir protoc -I . --js_out=import_style=commonjs:$dir --grpc-web_out=import_style=commonjs,mode=grpcwebtext:$dir bdledger/api/common.proto protoc -I . --js_out=import_style=commonjs:$dir --grpc-web_out=import_style=commonjs,mode=grpcwebtext:$dir bdledger/api/error_details.proto +protoc -I . --js_out=import_style=commonjs:$dir --grpc-web_out=import_style=commonjs,mode=grpcwebtext:$dir bdledger/api/node.proto protoc -I . --js_out=import_style=commonjs:$dir --grpc-web_out=import_style=commonjs,mode=grpcwebtext:$dir bdledger/api/ledger.proto protoc -I . --js_out=import_style=commonjs:$dir --grpc-web_out=import_style=commonjs,mode=grpcwebtext:$dir bdledger/api/query.proto -protoc -I . --js_out=import_style=commonjs:$dir --grpc-web_out=import_style=commonjs,mode=grpcwebtext:$dir bdledger/api/node.proto