diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-07-24 21:43:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-25 01:43:30 +0000 |
commit | 84b7504d0fdccc07b9f7412408c954ae07765ccb (patch) | |
tree | 3fed62c67573cb4da49ec1a634dbe4f2277c5a0c /cli/tools/registry/tar.rs | |
parent | 5f5f662a68c1425ce5080bc430e72364d4055af4 (diff) |
fix(workspaces/publish): include the license file from the workspace root if not in pkg (#24714)
Diffstat (limited to 'cli/tools/registry/tar.rs')
-rw-r--r-- | cli/tools/registry/tar.rs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/cli/tools/registry/tar.rs b/cli/tools/registry/tar.rs index f98d4b09c..27e416537 100644 --- a/cli/tools/registry/tar.rs +++ b/cli/tools/registry/tar.rs @@ -34,7 +34,7 @@ pub struct PublishableTarball { } pub fn create_gzipped_tarball( - publish_paths: &[CollectedPublishPath], + publish_paths: Vec<CollectedPublishPath>, source_parser: LazyGraphSourceParser, diagnostics_collector: &PublishDiagnosticsCollector, unfurler: &SpecifierUnfurler, @@ -45,15 +45,17 @@ pub fn create_gzipped_tarball( for path in publish_paths { let path_str = &path.relative_path; let specifier = &path.specifier; - let path = &path.path; - let content = resolve_content_maybe_unfurling( - path, - specifier, - unfurler, - source_parser, - diagnostics_collector, - )?; + let content = match path.maybe_content { + Some(content) => content.clone(), + None => resolve_content_maybe_unfurling( + &path.path, + specifier, + unfurler, + source_parser, + diagnostics_collector, + )?, + }; files.push(PublishableTarballFile { path_str: path_str.clone(), @@ -65,7 +67,7 @@ pub fn create_gzipped_tarball( tar .add_file(format!(".{}", path_str), &content) .with_context(|| { - format!("Unable to add file to tarball '{}'", path.display()) + format!("Unable to add file to tarball '{}'", path.path.display()) })?; } |