diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c625841..704334bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,11 +231,11 @@ if(NOT SUNSHINE_ASSETS_DIR) endif() if(NOT SUNSHINE_CONFIG_DIR) - set(SUNSHINE_CONFIG_DIR SUNSHINE_ASSETS_DIR) + set(SUNSHINE_CONFIG_DIR "${SUNSHINE_ASSETS_DIR}") endif() if(NOT SUNSHINE_DEFAULT_DIR) - set(SUNSHINE_DEFAULT_DIR SUNSHINE_ASSETS_DIR) + set(SUNSHINE_DEFAULT_DIR "${SUNSHINE_ASSETS_DIR}") endif() list(APPEND CBS_EXTERNAL_LIBRARIES diff --git a/sunshine/config.cpp b/sunshine/config.cpp index 8bb511e3..02a5438a 100644 --- a/sunshine/config.cpp +++ b/sunshine/config.cpp @@ -578,7 +578,7 @@ int apply_flags(const char *line) { void apply_config(std::unordered_map &&vars) { if(!fs::exists(stream.file_apps.c_str())) { - fs::copy_file(SUNSHINE_DEFAULT_DIR "/" APPS_JSON, stream.file_apps); + fs::copy_file(SUNSHINE_DEFAULT_DIR "/" APPS_JSON, stream.file_apps); } for(auto &[name, val] : vars) { @@ -763,8 +763,8 @@ int parse(int argc, char *argv[]) { } } - if(!fs::exists(sunshine.config_file.c_str())) { - fs::copy_file(SUNSHINE_DEFAULT_DIR "/sunshine.conf", sunshine.config_file); + if(!fs::exists(sunshine.config_file)) { + fs::copy_file(SUNSHINE_DEFAULT_DIR "/sunshine.conf", sunshine.config_file); } auto vars = parse_config(read_file(sunshine.config_file.c_str()));