From 5abd60fca5a3b1647fa1234fe0e36f34e7a4d850 Mon Sep 17 00:00:00 2001 From: Philip Rideout Date: Fri, 30 Nov 2018 09:23:22 -0800 Subject: [PATCH] Mipgen now creates the out dir if needed. --- tools/mipgen/src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/mipgen/src/main.cpp b/tools/mipgen/src/main.cpp index 3e3117cf11..e11f75d587 100644 --- a/tools/mipgen/src/main.cpp +++ b/tools/mipgen/src/main.cpp @@ -338,6 +338,7 @@ int main(int argc, char* argv[]) { } vector fileContents(container.getSerializedLength()); container.serialize(fileContents.data(), fileContents.size()); + Path(outputPattern).getParent().mkdirRecursive(); ofstream outputStream(outputPattern, ios::out | ios::binary); outputStream.write((const char*) fileContents.data(), fileContents.size()); outputStream.close(); @@ -354,6 +355,7 @@ int main(int argc, char* argv[]) { cerr << "Output pattern is too long." << endl; return 1; } + Path(path).getParent().mkdirRecursive(); ofstream outputStream(path, ios::binary | ios::trunc); if (!outputStream) { cerr << "The output file cannot be opened: " << path << endl;