Skip to content

Commit

Permalink
Fix tracker directives logic (#40)
Browse files Browse the repository at this point in the history
* Fix tracker directives logic

* Create nice-schools-design.md
  • Loading branch information
yanthomasdev authored Nov 4, 2023
1 parent f7a28f4 commit 947892d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-schools-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lunariajs/core": patch
---

Fix tracker directives logic
11 changes: 6 additions & 5 deletions packages/core/src/tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,12 @@ function findLastMajorCommit(

const pathsOrGlobsList = pathsOrGlobs.split(';');

// TODO: Test if this is working
pathsOrGlobsList.find((pathOrGlob) => {
if (directive === '@tracker-major') return micromatch.isMatch(filePath, pathOrGlob);
if (directive === '@tracker-minor') return !micromatch.isMatch(filePath, pathOrGlob);
});
return (
pathsOrGlobsList.find((pathOrGlob) => {
if (directive === '@tracker-major') return micromatch.isMatch(filePath, pathOrGlob);
if (directive === '@tracker-minor') return !micromatch.isMatch(filePath, pathOrGlob);
}) !== undefined
);
});
}

Expand Down

0 comments on commit 947892d

Please sign in to comment.