avoid changing id manually

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-07-30 07:09:31 +08:00
parent 040267e7f2
commit 53f496c0e4
4 changed files with 54 additions and 4 deletions

View File

@@ -166,7 +166,7 @@ fn main() {
}
fn import_config(path: &str) {
use hbb_common::{config::*, get_modified_time};
use hbb_common::{config::*, get_exe_time, get_modified_time};
let path2 = path.replace(".toml", "2.toml");
let path2 = std::path::Path::new(&path2);
let path = std::path::Path::new(path);
@@ -176,7 +176,9 @@ fn import_config(path: &str) {
log::info!("Empty source config, skipped");
return;
}
if get_modified_time(&path) > get_modified_time(&Config::file()) {
if get_modified_time(&path) > get_modified_time(&Config::file())
&& get_modified_time(&path) < get_exe_time()
{
if store_path(Config::file(), config).is_err() {
log::info!("config written");
}