change location to file path
Co-authored-by: Alpisc <Alpisc@users.noreply.github.com>
This commit is contained in:
parent
31b8e5bf0a
commit
26aeb75bd1
10
src/lib.rs
10
src/lib.rs
@ -27,10 +27,10 @@ pub fn get_args() -> Vec<String> {
|
|||||||
// todo!("Get request");
|
// todo!("Get request");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
pub fn import_file(location:&String) -> bool {
|
pub fn import_file(file_path:&String) -> bool {
|
||||||
if std::path::Path::new(&(location.clone()+"/export.ipassx")).exists() {
|
if std::path::Path::new(file_path).exists() {
|
||||||
let mut reader = brotli::Decompressor::new(
|
let mut reader = brotli::Decompressor::new(
|
||||||
File::open(location.clone()+"/export.ipassx").unwrap(),
|
File::open(file_path).unwrap(),
|
||||||
4096, // buffer size
|
4096, // buffer size
|
||||||
);
|
);
|
||||||
let mut content: String = String::new();
|
let mut content: String = String::new();
|
||||||
@ -70,7 +70,7 @@ pub fn import_file(location:&String) -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn export_file(location:&String) -> bool {
|
pub fn export_file(file_path:&String) -> bool {
|
||||||
let mut collected_data: String = String::new();
|
let mut collected_data: String = String::new();
|
||||||
|
|
||||||
let paths = read_dir(get_ipass_folder()).unwrap();
|
let paths = read_dir(get_ipass_folder()).unwrap();
|
||||||
@ -82,7 +82,7 @@ pub fn export_file(location:&String) -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Ok(file) = File::create(location.clone()+"/export.ipassx") {
|
if let Ok(file) = File::create(file_path) {
|
||||||
let mut writer = brotli::CompressorWriter::new(
|
let mut writer = brotli::CompressorWriter::new(
|
||||||
file,
|
file,
|
||||||
4096,
|
4096,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user