From 74a4dbc325ccfd82ddefdf2975ff8b4dc1ba72b2 Mon Sep 17 00:00:00 2001 From: zhouhang95 <765229842@qq.com> Date: Wed, 17 Apr 2024 14:29:35 +0800 Subject: [PATCH] clean --- zeno/src/nodes/prim/SimpleGeometry.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/zeno/src/nodes/prim/SimpleGeometry.cpp b/zeno/src/nodes/prim/SimpleGeometry.cpp index 91ce527e58..224a927490 100644 --- a/zeno/src/nodes/prim/SimpleGeometry.cpp +++ b/zeno/src/nodes/prim/SimpleGeometry.cpp @@ -1436,14 +1436,20 @@ struct RemoveFolder : zeno::INode { virtual void apply() override { namespace fs = std::filesystem; auto folderPath = fs::u8path(get_input2("folderPath")); - std::error_code errorCode; - fs::remove_all(folderPath, errorCode); + if (fs::exists(folderPath)) { + std::error_code errorCode; + fs::remove_all(folderPath, errorCode); + if (get_input2("clean")) { + fs::create_directories(folderPath); + } + } } }; ZENDEFNODE(RemoveFolder, { { - {"directory", "folderPath"} + {"directory", "folderPath"}, + {"bool", "clean", "false"}, }, {}, {},