Skip to content

Commit

Permalink
allow adding directories to assets (#17)
Browse files Browse the repository at this point in the history
Signed-off-by: karthik2804 <[email protected]>
  • Loading branch information
karthik2804 authored Jul 22, 2024
1 parent 32baeca commit 0649aa9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ impl PluginifyCommand {
let mut tar_builder = tar::Builder::new(&mut enc);
tar_builder.append_path_with_name(&package, &name)?;
for asset in ps.assets() {
tar_builder.append_path(asset).with_context(|| format!("Adding {}", asset.display()))?;
if asset.is_dir() {
tar_builder.append_dir_all(asset, asset)
.with_context(|| format!("Adding {}", asset.display()))?;
} else {
tar_builder.append_path(asset).with_context(|| format!("Adding {}", asset.display()))?;
}
}
tar_builder.finish()?;
}
Expand Down

0 comments on commit 0649aa9

Please sign in to comment.