summaryrefslogtreecommitdiff
path: root/cli/tools/registry/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/registry/mod.rs')
-rw-r--r--cli/tools/registry/mod.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs
index 34e803c73..d6e06fb58 100644
--- a/cli/tools/registry/mod.rs
+++ b/cli/tools/registry/mod.rs
@@ -449,6 +449,8 @@ impl PublishPreparer {
let cli_options = self.cli_options.clone();
let source_cache = self.source_cache.clone();
let config_path = config_path.clone();
+ let config_url = deno_json.specifier.clone();
+ let has_license_field = package.license.is_some();
move || {
let root_specifier =
ModuleSpecifier::from_directory_path(&root_dir).unwrap();
@@ -467,7 +469,9 @@ impl PublishPreparer {
&diagnostics_collector,
);
- if !has_license_file(publish_paths.iter().map(|p| &p.specifier)) {
+ if !has_license_field
+ && !has_license_file(publish_paths.iter().map(|p| &p.specifier))
+ {
if let Some(license_path) =
resolve_license_file(&root_dir, cli_options.workspace())
{
@@ -483,7 +487,7 @@ impl PublishPreparer {
});
} else {
diagnostics_collector.push(PublishDiagnostic::MissingLicense {
- expected_path: root_dir.join("LICENSE"),
+ config_specifier: config_url,
});
}
}