mirror of
https://github.com/lifegpc/game-auto-sync.git
synced 2026-06-06 05:48:58 +08:00
Bug fix
This commit is contained in:
18
src/cfg.rs
18
src/cfg.rs
@@ -71,19 +71,13 @@ impl Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn game_backuper_cfg(&self) -> String {
|
pub fn game_backuper_cfg(&self) -> Option<String> {
|
||||||
match self.get_str("game_backuper_cfg") {
|
let mut pb = crate::utils::get_exe_path_else_current();
|
||||||
Some(s) => {
|
pb.push(self.get_str("game_backuper_cfg").unwrap_or("game_backuper.yml"));
|
||||||
let mut pb = crate::utils::get_exe_path_else_current();
|
if !pb.exists() {
|
||||||
pb.push(s);
|
return None;
|
||||||
pb.to_string_lossy().to_string()
|
|
||||||
},
|
|
||||||
None => {
|
|
||||||
let mut pb = crate::utils::get_exe_path_else_current();
|
|
||||||
pb.push("game_backuper.yml");
|
|
||||||
pb.to_string_lossy().to_string()
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
Some(pb.to_string_lossy().to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn game_backuper_exe(&self) -> String {
|
pub fn game_backuper_exe(&self) -> String {
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ impl Main {
|
|||||||
Some(cml) => cml,
|
Some(cml) => cml,
|
||||||
None => {
|
None => {
|
||||||
let mut def = vec![self._cfg.game_backuper_exe()];
|
let mut def = vec![self._cfg.game_backuper_exe()];
|
||||||
let cfg_path = self._cfg.game_backuper_cfg();
|
if let Some(cfg_path) = self._cfg.game_backuper_cfg() {
|
||||||
if std::fs::exists(&cfg_path).unwrap_or(false) {
|
|
||||||
def.push(String::from("-c"));
|
def.push(String::from("-c"));
|
||||||
def.push(cfg_path);
|
def.push(cfg_path);
|
||||||
}
|
}
|
||||||
@@ -74,8 +73,7 @@ impl Main {
|
|||||||
Some(cml) => cml,
|
Some(cml) => cml,
|
||||||
None => {
|
None => {
|
||||||
let mut def = vec![self._cfg.game_backuper_exe()];
|
let mut def = vec![self._cfg.game_backuper_exe()];
|
||||||
let cfg_path = self._cfg.game_backuper_cfg();
|
if let Some(cfg_path) = self._cfg.game_backuper_cfg() {
|
||||||
if std::fs::exists(&cfg_path).unwrap_or(false) {
|
|
||||||
def.push(String::from("-c"));
|
def.push(String::from("-c"));
|
||||||
def.push(cfg_path);
|
def.push(cfg_path);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user