qatools-cli 1.2.31 → 1.2.32

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.
Files changed (3) hide show
  1. package/hooks.js +7 -2
  2. package/package.json +1 -1
  3. package/qatools.js +3028 -3004
package/hooks.js CHANGED
@@ -65,10 +65,15 @@ function refusalText(res) {
65
65
  }
66
66
 
67
67
  // Runs inside the git hook: exit 1 refuses the commit
68
- function runCommitCheck(file, cwd = process.cwd()) {
68
+ function runCommitCheck(file, cwd = process.cwd(), { refresh } = {}) {
69
69
  let message = "";
70
70
  try { message = fs.readFileSync(file, "utf8"); } catch { return 0; }
71
- const res = checkMessage(message, readKeyCache(cwd)?.keys || null);
71
+ let res = checkMessage(message, readKeyCache(cwd)?.keys || null);
72
+ // IMP-33: the cache may predate a requirement created moments ago — refresh it once and check again
73
+ if (!res.ok && refresh) {
74
+ try { refresh(); } catch { /* offline: keep the first answer */ }
75
+ res = checkMessage(message, readKeyCache(cwd)?.keys || null);
76
+ }
72
77
  if (res.warning) console.error(res.warning);
73
78
  if (res.ok) return 0;
74
79
  console.error(refusalText(res));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qatools-cli",
3
- "version": "1.2.31",
3
+ "version": "1.2.32",
4
4
  "description": "CLI for QA Tools — requirements, epics, sprints, sessions, App Context sync, project agenda. The companion to qa-tools.com.",
5
5
  "scripts": {
6
6
  "release": "npm version patch --no-git-tag-version && npm publish",