Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
oluceps committed Dec 12, 2024
1 parent a88f1ab commit 1d3764a
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/util/secmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,23 @@ impl<'a> RencCtx<'a, AgeEnc> {
.map(|i| {
let file = {
let file_pathbuf = PathBuf::from(&i.file);

if flake_root.is_some() && file_pathbuf.is_relative() {
let mut flake_root = flake_root.clone().expect("yes");
if file_pathbuf.is_absolute() {
file_pathbuf
} else {
let mut flake_root = flake_root.clone().expect("checked");
flake_root.push(file_pathbuf);
flake_root
} else {
file_pathbuf
}
};
(
i,
({
file.canonicalize()
.wrap_err_with(|| eyre!("secret not found: {}", i.file))
.and_then(|i| {
SecPathBuf::<InStore>::from(&i)
.read_buffer()
.map(SecBuf::new)
})
}),
file.canonicalize()
.wrap_err_with(|| eyre!("secret not found: {}", i.file))
.and_then(|i| {
SecPathBuf::<InStore>::from(&i)
.read_buffer()
.map(SecBuf::new)
}),
)
})
.collect();
Expand Down

0 comments on commit 1d3764a

Please sign in to comment.