diff --git a/dtmcli/db_special.go b/dtmcli/db_special.go index 12769eb..cb61e90 100644 --- a/dtmcli/db_special.go +++ b/dtmcli/db_special.go @@ -85,7 +85,7 @@ func GetDBSpecial() DBSpecial { // SetCurrentDBType set currentDBType func SetCurrentDBType(dbType string) { spec := dbSpecials[dbType] - PanicIf(spec == nil, fmt.Errorf("unknown db type %s", dbType)) + PanicIf(spec == nil, fmt.Errorf("unknown db type '%s'", dbType)) currentDBType = dbType } diff --git a/helper/sync-dtmcli.sh b/helper/sync-dtmcli.sh old mode 100644 new mode 100755 index 2fabffd..f399fe8 --- a/helper/sync-dtmcli.sh +++ b/helper/sync-dtmcli.sh @@ -1,11 +1,12 @@ #! /bin/bash set -x -if [ x$1 == x ]; then +ver=$1 +if [ x$ver == x ]; then echo please specify you version like vx.x.x; exit 1; fi -if [ ${1:1:1} != v ]; then +if [ ${ver:0:1} != v ]; then echo please specify you version like vx.x.x; exit 1; fi @@ -15,40 +16,43 @@ cp ../dtm/dtmcli/*.go ./ rm -f *_test.go go mod tidy go build || exit 1 - git add . -git commit -m'update from dtm' +git commit -m"update from dtm to version $ver" git push -# git tag $1 -# git push --tags +git tag $ver +git push --tags cd ../dtmcli-go-sample +sleep 5 go get -u github.com/yedf/dtmcli go mod tidy go build || exit 1 git add . -git commit -m'update from dtm' +git commit -m"update from dtm to version $ver" git push cd ../dtmgrpc cp ../dtm/dtmgrpc/*.go ./ cp ../dtm/dtmgrpc/*.proto ./ - +go get -u github.com/yedf/dtmcli sed -i '' -e 's/yedf\/dtm\//yedf\//g' *.go *.proto rm -rf *_test.go -go get -u github.com/yedf/dtmcli go mod tidy go build || exit 1 git add . -git commit -m'update from dtm' +git commit -m"update from dtm to version $ver" git push -# git tag $1 -# git push --tags +git tag $ver +git push --tags cd ../dtmgrpc-go-sample +sleep 5 go get -u github.com/yedf/dtmcli go get -u github.com/yedf/dtmgrpc +cp ../dtm/dtmgrpc/*.proto ./ +sed -i '' -e 's/yedf\/dtm\//yedf\//g' *.go *.proto +protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative busi/*.proto || exit 1 go build || exit 1 git add . -git commit -m'update from dtm' +git commit -m"update from dtm to version $ver" git push \ No newline at end of file