aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/main.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-10-17 20:35:54 +0200
committerGitHub <[email protected]>2023-10-17 20:35:54 +0200
commitd3e396f7ecd3bcf2df30d2ba203b3548cf6ab5e0 (patch)
tree1ff10db41dc5ba53896ebb7cab1ff840010351ba /src/zenserver/main.cpp
parentremoved unnecessary vector in ZenCacheMemoryLayer::Drop (diff)
downloadzen-d3e396f7ecd3bcf2df30d2ba203b3548cf6ab5e0.tar.xz
zen-d3e396f7ecd3bcf2df30d2ba203b3548cf6ab5e0.zip
added command line option to start server clean (#481)
when specified with `--clean`, the data directory will be wiped clean at startup
Diffstat (limited to 'src/zenserver/main.cpp')
-rw-r--r--src/zenserver/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp
index d57722143..f482e6737 100644
--- a/src/zenserver/main.cpp
+++ b/src/zenserver/main.cpp
@@ -334,6 +334,11 @@ main(int argc, char* argv[])
ZenServerOptions ServerOptions;
ParseCliOptions(argc, argv, ServerOptions);
+ if (ServerOptions.IsCleanStart)
+ {
+ DeleteDirectories(ServerOptions.DataDir);
+ }
+
if (!std::filesystem::exists(ServerOptions.DataDir))
{
ServerOptions.IsFirstRun = true;