Fix setting default SUNSHINE_DEFAULT_DIR

This commit is contained in:
loki 2021-07-27 18:55:41 +02:00
parent da3ed5ff79
commit 9a5d23ebde
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -578,7 +578,7 @@ int apply_flags(const char *line) {
void apply_config(std::unordered_map<std::string, std::string> &&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()));