cli: fix issue where negate removes too many packages
This commit is contained in:
parent
5a82e0308b
commit
7d40abfb3f
|
@ -51,7 +51,7 @@ exports.handler = async ({axios, specfile}) => {
|
||||||
|
|
||||||
const installed = packages.filter(pkg => pkg.installed);
|
const installed = packages.filter(pkg => pkg.installed);
|
||||||
|
|
||||||
const ensure_packages = [];
|
let ensure_packages = [];
|
||||||
|
|
||||||
for(const rule of rules){
|
for(const rule of rules){
|
||||||
if(rule.comment) continue;
|
if(rule.comment) continue;
|
||||||
|
@ -78,10 +78,9 @@ exports.handler = async ({axios, specfile}) => {
|
||||||
ensure_packages.push(match)
|
ensure_packages.push(match)
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
for(const package of ensure_packages){
|
ensure_packages = ensure_packages.filter(
|
||||||
if(does_match(package, rule))
|
pkg => !does_match(pkg, rule)
|
||||||
ensure_packages.splice(ensure_packages.indexOf(package))
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue