@trivoallan/ontrack-product 0.1.0 → 0.1.1

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.
@@ -96,12 +96,14 @@ function accepted(root, number, by) {
96
96
  throw new CheckError(`${by}: ${number} must be accepted first (it is ${f.status || 'not ruled'})`);
97
97
  return { file: rel(root, path), f };
98
98
  }
99
- // Markdown files tracked by git, relative to the root.
99
+ // Markdown files tracked by git, relative to the root, that are still on
100
+ // disk: a tracked file deleted from the working tree, not yet staged, is
101
+ // not there to read.
100
102
  function tracked(root) {
101
103
  const r = spawnSync('git', ['ls-files', '-z', '--', '*.md'], { cwd: root, encoding: 'utf8' });
102
104
  if (r.status !== 0)
103
105
  throw new CheckError(`git ls-files failed in ${root}: ${r.stderr.trim()}`);
104
- return r.stdout.split('\0').filter(Boolean);
106
+ return r.stdout.split('\0').filter((p) => p && existsSync(join(root, p)));
105
107
  }
106
108
  const under = (dir, path) => dir === '.' || path.startsWith(`${dir}/`);
107
109
  // ADR-0003's root, normalised without its trailing slash, refused outside the repository.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trivoallan/ontrack-product",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Product-management conventions your repositories import as ADRs: toolkit, where artifacts live, the evidence they claim, and when a change may build on them. Checked in CI.",
5
5
  "license": "MIT-0",
6
6
  "keywords": [