Skip to content

Commit

Permalink
fix: module path using stripping a prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
dynamite-bud committed Oct 24, 2023
1 parent 9127dde commit fe3613e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/registry/src/package/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,15 @@ fn construct_tar_gz(

if let Some(bindings) = &module.bindings {
for path in bindings.referenced_files(manifest_dir)? {
append_path_to_tar_gz(&mut builder, manifest_dir, &path).map_err(
let relative_path = path.strip_prefix(manifest_dir).with_context(|| {
format!(
"\"{}\" should be inside \"{}\"",
path.display(),
manifest_dir.display(),
)
})?;

append_path_to_tar_gz(&mut builder, manifest_dir, relative_path).map_err(
|(normalized_path, _)| PackageBuildError::MissingBindings {
module: module.name.clone(),
path: normalized_path,
Expand Down

0 comments on commit fe3613e

Please sign in to comment.