mirror of
https://github.com/LizardByte/Sunshine.git
synced 2024-11-18 02:09:49 +00:00
Not create unnecessary variables and make fs use strings directly instead of converting them
This commit is contained in:
parent
c39f2b0c1f
commit
2e8b462fe5
@ -574,8 +574,7 @@ int apply_flags(const char *line) {
|
|||||||
|
|
||||||
void apply_config(std::unordered_map<std::string, std::string> &&vars) {
|
void apply_config(std::unordered_map<std::string, std::string> &&vars) {
|
||||||
if(!fs::exists(stream.file_apps.c_str())) {
|
if(!fs::exists(stream.file_apps.c_str())) {
|
||||||
std::string sunshine_apps_default = SUNSHINE_DEFAULT_DIR "/" APPS_JSON;
|
fs::copy_file(SUNSHINE_DEFAULT_DIR "/" APPS_JSON, stream.file_apps);
|
||||||
fs::copy_file(sunshine_apps_default.c_str(), stream.file_apps.c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto &[name, val] : vars) {
|
for(auto &[name, val] : vars) {
|
||||||
@ -760,8 +759,7 @@ int parse(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!fs::exists(sunshine.config_file.c_str())) {
|
if(!fs::exists(sunshine.config_file.c_str())) {
|
||||||
std::string sunshine_config_default = SUNSHINE_DEFAULT_DIR "/sunshine.conf";
|
fs::copy_file(SUNSHINE_DEFAULT_DIR "/sunshine.conf", sunshine.config_file);
|
||||||
fs::copy_file(sunshine_config_default.c_str(), sunshine.config_file.c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto vars = parse_config(read_file(sunshine.config_file.c_str()));
|
auto vars = parse_config(read_file(sunshine.config_file.c_str()));
|
||||||
|
Loading…
Reference in New Issue
Block a user