From 4eda9e64126c50b15faead451febe170a6a88928 Mon Sep 17 00:00:00 2001 From: loki Date: Sun, 8 Dec 2019 19:21:27 +0100 Subject: [PATCH] Check for existence of configuration file --- sunshine/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sunshine/main.cpp b/sunshine/main.cpp index 476bffc0..2d86a4c4 100644 --- a/sunshine/main.cpp +++ b/sunshine/main.cpp @@ -3,6 +3,8 @@ // #include +#include +#include #include "nvhttp.h" #include "stream.h" @@ -16,6 +18,11 @@ extern "C" { using namespace std::literals; int main(int argc, char *argv[]) { if(argc > 1) { + if(!std::filesystem::exists(argv[1])) { + std::cout << "Error: Couln't find configuration file ["sv << argv[1] << ']' << std::endl; + return 7; + } + config::parse_file(argv[1]); }