Skip to content

Commit

Permalink
feat: config existence check
Browse files Browse the repository at this point in the history
  • Loading branch information
dongwlin committed Nov 19, 2023
1 parent 1a00912 commit 268fe4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/cli/Config/Config.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#include "Config.h"

bool Config::exists()
{
return std::filesystem::exists(_target_path);
}

bool Config::load()
{
auto config_opt = json::open(_target_path);
Expand Down
1 change: 1 addition & 0 deletions source/cli/Config/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Config
virtual ~Config() = default;

public:
virtual bool exists();
virtual bool parse(const json::value& config_json) = 0;
virtual bool load();
virtual json::value to_json() = 0;
Expand Down

0 comments on commit 268fe4b

Please sign in to comment.