diff options
-rwxr-xr-x | src/protoc-c.sh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/protoc-c.sh b/src/protoc-c.sh index 163ff7d..4147799 100755 --- a/src/protoc-c.sh +++ b/src/protoc-c.sh @@ -2,10 +2,12 @@ PROTOC_C=${PROTOC_C:-protoc-c} -mkdir -p .protoc-c_build/ -cp $1 .protoc-c_build/ -cd .protoc-c_build/ +build_dir=".protoc-c_build_$(basename $2)/" + +mkdir -p "${build_dir}" +cp $1 "${build_dir}" +cd "${build_dir}" eval $PROTOC_C --c_out=. $(basename $1) cd .. -mv .protoc-c_build/$(basename $2) $2 -rm -rf .protoc-c_build/ +mv "${build_dir}/$(basename $2)" $2 +rm -rf "${build_dir}" |