Repaired the default settings file being generated in a wrong location.
This commit is contained in:
parent
4faf3b05aa
commit
77e16e3573
1 changed files with 2 additions and 2 deletions
|
|
@ -220,6 +220,7 @@ impl SettingsInJson {
|
||||||
exe_path.pop();
|
exe_path.pop();
|
||||||
let path = exe_path.join(Path::new(SETTING_FILENAME));
|
let path = exe_path.join(Path::new(SETTING_FILENAME));
|
||||||
if !path.as_path().exists() || !path.is_file() {
|
if !path.as_path().exists() || !path.is_file() {
|
||||||
|
println!("Configuration file not found. Generating a default one.");
|
||||||
let default = SettingsInJson::default_settings();
|
let default = SettingsInJson::default_settings();
|
||||||
default.save();
|
default.save();
|
||||||
return default;
|
return default;
|
||||||
|
|
@ -236,8 +237,7 @@ impl SettingsInJson {
|
||||||
println!("WARNING: Failed to save settings: can't find exe path.");
|
println!("WARNING: Failed to save settings: can't find exe path.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let mut path = exe_path.unwrap();
|
let path = exe_path.unwrap();
|
||||||
path.pop();
|
|
||||||
let file = File::create(&path.with_file_name(SETTING_FILENAME)).unwrap();
|
let file = File::create(&path.with_file_name(SETTING_FILENAME)).unwrap();
|
||||||
let mut writer = BufWriter::new(file);
|
let mut writer = BufWriter::new(file);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue