diff --git a/hack/gen_protoc.sh b/hack/gen_protoc.sh index 03d5c33c1..0f9ce2ea1 100644 --- a/hack/gen_protoc.sh +++ b/hack/gen_protoc.sh @@ -9,15 +9,15 @@ PROTO_SRC=$@ arch=$(get_arch) +# if protoc-c is 1.4.x if protoc-c --version | grep -q -E "protobuf-c 1\.4\.[0-9]"; then protoc-c --proto_path=$PROTO_PATH --c_out=. $PROTO_SRC else echo "Generate proto files in docker" - echo $PROTO_PATH - echo $PROTO_SRC docker run --rm \ -v $ROOT_DIR:/kmesh \ - --name kmesh-build "ghcr.io/kmesh-net/kmesh-build-${arch}:latest" \ - cd /kmesh/api && protoc-c --proto_path=$PROTO_PATH --c_out=. $PROTO_SRC + --name kmesh-build \ + ghcr.io/kmesh-net/kmesh-build-${arch}:latest \ + sh -c "cd /kmesh/api && protoc-c --proto_path=$PROTO_PATH --c_out=. $PROTO_SRC" fi