fix import config bug when use filename insteadof path
This commit is contained in:
parent
7dfa038c6d
commit
79145859d5
11
src/main.rs
11
src/main.rs
@ -134,7 +134,16 @@ fn main() {
|
|||||||
}
|
}
|
||||||
} else if args[0] == "--import-config" {
|
} else if args[0] == "--import-config" {
|
||||||
if args.len() == 2 {
|
if args.len() == 2 {
|
||||||
import_config(&args[1]);
|
let mut filepath = args[1].to_owned();
|
||||||
|
let path = std::path::Path::new(&args[1]);
|
||||||
|
if !path.is_absolute() {
|
||||||
|
let mut cur = std::env::current_dir().unwrap();
|
||||||
|
cur.push(path);
|
||||||
|
filepath = cur.to_str().unwrap().to_string();
|
||||||
|
} else {
|
||||||
|
filepath = path.to_str().unwrap().to_string();
|
||||||
|
}
|
||||||
|
import_config(&filepath);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if args[0] == "--password" {
|
} else if args[0] == "--password" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user