mirror of
https://github.com/xavo95/repak.git
synced 2025-01-18 19:04:07 +00:00
Fix get
command prefix handling
This commit is contained in:
parent
1eb4c1cc77
commit
fbc862ce91
1 changed files with 4 additions and 4 deletions
|
@ -454,15 +454,15 @@ fn get(aes_key: Option<aes::Aes256>, args: ActionGet) -> Result<(), repak::Error
|
||||||
let mount_point = PathBuf::from(pak.mount_point());
|
let mount_point = PathBuf::from(pak.mount_point());
|
||||||
let prefix = Path::new(&args.strip_prefix);
|
let prefix = Path::new(&args.strip_prefix);
|
||||||
|
|
||||||
let full_path = mount_point.join(args.file);
|
let full_path = prefix.join(args.file);
|
||||||
let file = full_path
|
let file = full_path
|
||||||
.strip_prefix(prefix)
|
.strip_prefix(&mount_point)
|
||||||
.map_err(|_| repak::Error::PrefixMismatch {
|
.map_err(|_| repak::Error::PrefixMismatch {
|
||||||
path: full_path.to_string_lossy().to_string(),
|
path: full_path.to_string_lossy().to_string(),
|
||||||
prefix: prefix.to_string_lossy().to_string(),
|
prefix: mount_point.to_string_lossy().to_string(),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
std::io::stdout().write_all(&pak.get(&file.to_string_lossy(), &mut reader)?)?;
|
std::io::stdout().write_all(&pak.get(&file.to_slash_lossy(), &mut reader)?)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue