Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhang95 committed Apr 17, 2024
1 parent 19816e6 commit 74a4dbc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions zeno/src/nodes/prim/SimpleGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1436,14 +1436,20 @@ struct RemoveFolder : zeno::INode {
virtual void apply() override {
namespace fs = std::filesystem;
auto folderPath = fs::u8path(get_input2<std::string>("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<bool>("clean")) {
fs::create_directories(folderPath);
}
}
}
};

ZENDEFNODE(RemoveFolder, {
{
{"directory", "folderPath"}
{"directory", "folderPath"},
{"bool", "clean", "false"},
},
{},
{},
Expand Down

0 comments on commit 74a4dbc

Please sign in to comment.