@hasnaxyz/hook-checktasks 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +8 -3
- package/dist/hook.js +8 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -147,10 +147,15 @@ function run() {
|
|
|
147
147
|
if (hookInput?.transcript_path) {
|
|
148
148
|
sessionName = getSessionName(hookInput.transcript_path);
|
|
149
149
|
}
|
|
150
|
-
const nameToCheck = sessionName || config.taskListId || "";
|
|
151
150
|
const keywords = config.keywords || ["dev"];
|
|
152
|
-
const
|
|
153
|
-
|
|
151
|
+
const sessionMatchesKeywords = () => {
|
|
152
|
+
if (keywords.length === 0)
|
|
153
|
+
return true;
|
|
154
|
+
if (!sessionName)
|
|
155
|
+
return false;
|
|
156
|
+
return keywords.some((keyword) => sessionName.toLowerCase().includes(keyword.toLowerCase()));
|
|
157
|
+
};
|
|
158
|
+
if (!sessionMatchesKeywords()) {
|
|
154
159
|
approve();
|
|
155
160
|
}
|
|
156
161
|
let listsToCheck = [];
|
package/dist/hook.js
CHANGED
|
@@ -143,10 +143,15 @@ function run() {
|
|
|
143
143
|
if (hookInput?.transcript_path) {
|
|
144
144
|
sessionName = getSessionName(hookInput.transcript_path);
|
|
145
145
|
}
|
|
146
|
-
const nameToCheck = sessionName || config.taskListId || "";
|
|
147
146
|
const keywords = config.keywords || ["dev"];
|
|
148
|
-
const
|
|
149
|
-
|
|
147
|
+
const sessionMatchesKeywords = () => {
|
|
148
|
+
if (keywords.length === 0)
|
|
149
|
+
return true;
|
|
150
|
+
if (!sessionName)
|
|
151
|
+
return false;
|
|
152
|
+
return keywords.some((keyword) => sessionName.toLowerCase().includes(keyword.toLowerCase()));
|
|
153
|
+
};
|
|
154
|
+
if (!sessionMatchesKeywords()) {
|
|
150
155
|
approve();
|
|
151
156
|
}
|
|
152
157
|
let listsToCheck = [];
|