mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
flatc now creates the output directory if it doesn't exist yet.
Also cleaned up the general mkdir functionality. Tested: on OS X. Tested that a command line like: ./flatc -j -o foo/bar/baz tests/monster_test.fbs generates files in foo/bar/baz/MyGame/Example/*.java which previously didn't exist. Windows code was previously tested but has been moved, so needs to be tested again. Change-Id: Iee943121b3be4f92961a3ec94c2cb578165f114a
This commit is contained in:
@@ -180,6 +180,7 @@ int main(int argc, const char *argv[]) {
|
||||
|
||||
for (size_t i = 0; i < num_generators; ++i) {
|
||||
if (generator_enabled[i]) {
|
||||
flatbuffers::EnsureDirExists(output_path);
|
||||
if (!generators[i].generate(parser, output_path, filebase, opts)) {
|
||||
Error((std::string("Unable to generate ") +
|
||||
generators[i].name +
|
||||
|
||||
Reference in New Issue
Block a user