From c37f5c56e84ccce87b215fb6f28385eeee9c4f8c Mon Sep 17 00:00:00 2001 From: Jon-Michael Hartway Date: Wed, 3 Jan 2024 21:36:12 -0500 Subject: [PATCH] fixed rendered template not copying --- .../ProjectGenerator/ProjectGenerator.cpp | 14 ++++++++++++++ src/Project/TemplateManager.cpp | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Generators/ProjectGenerator/ProjectGenerator.cpp b/src/Generators/ProjectGenerator/ProjectGenerator.cpp index 6aebfe8..e0baad9 100644 --- a/src/Generators/ProjectGenerator/ProjectGenerator.cpp +++ b/src/Generators/ProjectGenerator/ProjectGenerator.cpp @@ -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; @@ -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; diff --git a/src/Project/TemplateManager.cpp b/src/Project/TemplateManager.cpp index f704a1b..5608612 100644 --- a/src/Project/TemplateManager.cpp +++ b/src/Project/TemplateManager.cpp @@ -204,7 +204,6 @@ namespace Frate { << new_file_path.string() << std::endl; } } - exit(-1); return tmp_gen_path; }