Skip to content

Commit

Permalink
feat: Respect rules for local includes
Browse files Browse the repository at this point in the history
  • Loading branch information
ke-lit committed Oct 30, 2024
1 parent a39e1b0 commit c1bf36d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/parser-includes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ export class ParserIncludes {
fileDoc["include"] = this.expandInclude(fileDoc["include"], opts.variables);
fileDoc["include"].forEach((inner: any, i: number) => {
if (!inner["local"]) return;
if (inner["rules"]) {
const rulesResult = Utils.getRulesResult({cwd: opts.cwd, variables: opts.variables, rules: inner["rules"]}, gitData);
if (rulesResult.when === "never") {
return;
}
}
fileDoc["include"][i] = {
project: value["project"],
file: inner["local"].replace(/^\//, ""),
Expand Down

0 comments on commit c1bf36d

Please sign in to comment.