Fixed proto_gen_shortcut script for OSX.

This commit is contained in:
yflu 2022-11-17 23:13:53 +08:00
parent 3e7718ed04
commit e432026fec
5 changed files with 320 additions and 652 deletions

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.4
// protoc v3.7.1
// source: room_downsync_frame.proto
package protos

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.4
// protoc v3.7.1
// source: geometry.proto
package sharedprotos

View File

@ -440,7 +440,7 @@
"array": [
0,
0,
371.5248982235242,
343.804582419974,
0,
0,
0,

6
proto_gen_shortcut.sh Normal file → Executable file
View File

@ -24,6 +24,10 @@ js_outdir=$js_basedir/assets/scripts/modules
# The specific filename is respected by "frontend/build-templates/wechatgame/game.js".
pbjs -t static-module -w commonjs --keep-case --force-message -o $js_outdir/room_downsync_frame_proto_bundle.forcemsg.js $js_basedir/assets/resources/pbfiles/geometry.proto $js_basedir/assets/resources/pbfiles/room_downsync_frame.proto
sed -i 's#require("protobufjs/minimal")#require("./protobuf-with-floating-num-decoding-endianess-toggle")#g' $js_outdir/room_downsync_frame_proto_bundle.forcemsg.js # Not working in OSX, needs further investigation
if [[ $OSTYPE == 'darwin'* ]]; then
sed -i '' -e 's#require("protobufjs/minimal")#require("./protobuf-with-floating-num-decoding-endianess-toggle")#g' $js_outdir/room_downsync_frame_proto_bundle.forcemsg.js
else
sed -i 's#require("protobufjs/minimal")#require("./protobuf-with-floating-num-decoding-endianess-toggle")#g' $js_outdir/room_downsync_frame_proto_bundle.forcemsg.js
fi
echo "JavaScript part done"