Skip to content

Commit 581bc90

Browse files
sdkrystianalandefreitas
authored andcommitted
fix: create generator output directory if it doesn't exist
1 parent bb41cf0 commit 581bc90

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/Support/Generator.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111

1212
#include "lib/AST/ParseJavadoc.hpp"
13+
#include "lib/Support/Path.hpp"
1314
#include <mrdox/Support/Error.hpp>
1415
#include <mrdox/Generator.hpp>
1516
#include <llvm/ADT/SmallString.h>
@@ -59,8 +60,11 @@ buildOne(
5960
std::string_view fileName,
6061
Corpus const& corpus) const
6162
{
62-
std::ofstream os;
63+
std::string dir = files::getParentDir(fileName);
64+
if(auto err = files::createDirectory(dir))
65+
return err;
6366

67+
std::ofstream os;
6468
try
6569
{
6670
os.open(std::string(fileName),

0 commit comments

Comments
 (0)