fix include exclude

This commit is contained in:
caesar
2025-01-16 09:20:36 +08:00
parent 484116be5c
commit a5b330c5bf
3 changed files with 33 additions and 25 deletions

View File

@@ -63,18 +63,15 @@ async function aiCheckDiffContext() {
let files = diffOutput.trim().split("\n");
for (let key in files) {
if (!files[key]) continue;
if (include_files.length > 0) {
if (!doesAnyPatternMatch(include_files, files[key])) {
console.log("exclude(include):", files[key])
continue;
}
}
if (exclude_files.length > 0) {
if (doesAnyPatternMatch(exclude_files, files[key])) {
console.log("exclude(exclude):", files[key])
continue;
}
console.log("check diff context:", files[key])
if ((include_files.length > 0) && (!doesAnyPatternMatch(include_files, files[key]))) {
console.log("exclude(include):", files[key])
continue;
} else if ((exclude_files.length > 0) && (doesAnyPatternMatch(exclude_files, files[key]))) {
console.log("exclude(exclude):", files[key])
continue;
}
const fileDiffOutput = execSync(`git diff origin/${BASE_REF}...HEAD -- "${files[key]}"`, {encoding: 'utf-8'});
// ai generate
try {