gen.sh
gen.sh - Overview
This script compiles a FlatBuffers schema and moves the generated Go files to the current directory.
Detailed Documentation
The script performs the following actions:
- Checks for
flatc
: Verifies if the FlatBuffers compiler (flatc
) is installed. If not, it executesinstall_flatbuffers.sh
to install it. - Compiles FlatBuffers schema: Compiles the
flatbuffer.fbs
file usingflatc
to generate Go source code.- Parameters:
--go
: Specifies that Go code should be generated.flatbuffer.fbs
: The FlatBuffers schema file to compile.
- Returns: Generates Go source code files in the
fb
directory.
- Parameters:
- Moves files: Moves the generated Go files from the
fb
directory to the current directory. - Removes directory: Removes the now-empty
fb
directory.