mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
fix(publish): make include and exclude work (#22720)
1. Stops `deno publish` using some custom include/exclude behaviour from other sub commands 2. Takes ancestor directories into account when resolving gitignore 3. Backards compatible change that adds ability to unexclude an exclude by using a negated glob at a more specific level for all sub commands (see https://github.com/denoland/deno_config/pull/44).
This commit is contained in:
parent
2ed984ba3a
commit
2dfc0aca7c
24 changed files with 1017 additions and 222 deletions
|
@ -388,23 +388,20 @@ fn collect_coverages(
|
|||
initial_cwd.to_path_buf(),
|
||||
)])
|
||||
} else {
|
||||
PathOrPatternSet::from_relative_path_or_patterns(
|
||||
PathOrPatternSet::from_include_relative_path_or_patterns(
|
||||
initial_cwd,
|
||||
&files.include,
|
||||
)?
|
||||
}
|
||||
}),
|
||||
exclude: PathOrPatternSet::from_relative_path_or_patterns(
|
||||
exclude: PathOrPatternSet::from_exclude_relative_path_or_patterns(
|
||||
initial_cwd,
|
||||
&files.ignore,
|
||||
)
|
||||
.context("Invalid ignore pattern.")?,
|
||||
};
|
||||
let file_paths = FileCollector::new(|file_path, _| {
|
||||
file_path
|
||||
.extension()
|
||||
.map(|ext| ext == "json")
|
||||
.unwrap_or(false)
|
||||
let file_paths = FileCollector::new(|e| {
|
||||
e.path.extension().map(|ext| ext == "json").unwrap_or(false)
|
||||
})
|
||||
.ignore_git_folder()
|
||||
.ignore_node_modules()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue