summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 27a768ba..0f68c3b2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -54,14 +54,17 @@ int main(int argc, char** argv) {
}
std::string next_arg = std::next(it)->c_str();
- if (!std::filesystem::exists(next_arg)) {
- std::cerr << "[ ERROR ] Config path '" << next_arg << "' doesn't exist!\n";
+ if (std::filesystem::is_symlink(next_arg))
+ next_arg = std::filesystem::read_symlink(next_arg);
+
+ if (!std::filesystem::is_regular_file(next_arg)) {
+ std::cerr << "[ ERROR ] Config file '" << next_arg << "' doesn't exist!\n";
help();
return 1;
}
- configPath = next_arg;
+ configPath = std::filesystem::weakly_canonical(next_arg);
Debug::log(LOG, "User-specified config location: '{}'", configPath);
it++;