Skip to content

Commit

Permalink
fixed rendered template not copying
Browse files Browse the repository at this point in the history
  • Loading branch information
DeaSTL committed Jan 4, 2024
1 parent beab83e commit c37f5c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/Generators/ProjectGenerator/ProjectGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ namespace Frate::Generators::Project {

LuaAPI::postScripts(lua, inter->pro);

Utils::info << "Copying rendered template to project" << std::endl;

std::filesystem::copy(
render_path, inter->pro->path,
std::filesystem::copy_options::recursive |
std::filesystem::copy_options::overwrite_existing);

// This ia bit of a hack, because create doesn't actually load a project so
// we have to emulate the loading process
inter->pro->loaded_json = true;
Expand Down Expand Up @@ -139,6 +146,13 @@ namespace Frate::Generators::Project {

LuaAPI::postScripts(lua, inter->pro);

Utils::verbose << "Copying rendered template to project" << std::endl;

std::filesystem::copy(
render_path, inter->pro->path,
std::filesystem::copy_options::recursive |
std::filesystem::copy_options::overwrite_existing);

std::filesystem::remove_all(render_path);

return true;
Expand Down
1 change: 0 additions & 1 deletion src/Project/TemplateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ namespace Frate {
<< new_file_path.string() << std::endl;
}
}
exit(-1);
return tmp_gen_path;
}

Expand Down

0 comments on commit c37f5c5

Please sign in to comment.