diff options
| author | Stefan Boberg <[email protected]> | 2023-10-17 20:35:54 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-17 20:35:54 +0200 |
| commit | d3e396f7ecd3bcf2df30d2ba203b3548cf6ab5e0 (patch) | |
| tree | 1ff10db41dc5ba53896ebb7cab1ff840010351ba /src/zenserver/main.cpp | |
| parent | removed unnecessary vector in ZenCacheMemoryLayer::Drop (diff) | |
| download | zen-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.cpp | 5 |
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; |