mirror of
https://github.com/pcvolkmer/osc-variant.git
synced 2025-04-19 19:56:50 +00:00
refactor: remove password-less wrapper function for OSB files
This commit is contained in:
parent
8be859d274
commit
f02a925e3f
@ -317,15 +317,8 @@ pub fn handle(command: SubCommand) -> Result<(), Box<dyn Error>> {
|
|||||||
password,
|
password,
|
||||||
dir,
|
dir,
|
||||||
} => {
|
} => {
|
||||||
use crate::unzip_osb::{unzip_osb, unzip_osb_using_password};
|
use crate::unzip_osb::unzip_osb;
|
||||||
match password {
|
unzip_osb(file.as_str(), dir.unwrap_or_default().as_str(), password)
|
||||||
Some(password) => unzip_osb_using_password(
|
|
||||||
file.as_str(),
|
|
||||||
dir.unwrap_or_default().as_str(),
|
|
||||||
password.as_str(),
|
|
||||||
),
|
|
||||||
None => unzip_osb(file.as_str(), dir.unwrap_or_default().as_str()),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,9 @@ macro_rules! error {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn unzip_osb_using_password(path: &str, dir: &str, password: &str) {
|
pub fn unzip_osb(path: &str, dir: &str, password: Option<String>) {
|
||||||
|
let password = password.unwrap_or_else(|| deobfuscate(env!("OSB_KEY").trim()));
|
||||||
|
|
||||||
println!("Entpacke OSB-Datei {}\n", style(path).yellow());
|
println!("Entpacke OSB-Datei {}\n", style(path).yellow());
|
||||||
|
|
||||||
let file = match fs::File::open(path) {
|
let file = match fs::File::open(path) {
|
||||||
@ -125,7 +127,3 @@ pub fn unzip_osb_using_password(path: &str, dir: &str, password: &str) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn unzip_osb(path: &str, dir: &str) {
|
|
||||||
unzip_osb_using_password(path, dir, deobfuscate(env!("OSB_KEY").trim()).as_str());
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user