breakaway 1.0.2-main.10 → 1.0.2-main.12
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/package.json +1 -1
- package/scripts/tasks/hook-config.js +21 -3
- package/src/cli-version.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "breakaway",
|
|
3
|
-
"version": "1.0.2-main.
|
|
3
|
+
"version": "1.0.2-main.12",
|
|
4
4
|
"description": "The task board for you and your coding agents: a Cloudflare Worker, its web app, Taskwarrior sync, and the CLI (npx breakaway).",
|
|
5
5
|
"license": "FSL-1.1-Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -3,14 +3,32 @@
|
|
|
3
3
|
* `tasks claim`) and where the board is, found the same way as the CLI (scripts/tasks/settings.js).
|
|
4
4
|
* Each returns null/undefined rather than throwing when something's missing, because the hooks stay quiet.
|
|
5
5
|
*/
|
|
6
|
+
import { execFileSync } from 'node:child_process';
|
|
6
7
|
import { existsSync, readFileSync } from 'node:fs';
|
|
7
8
|
import { homedir } from 'node:os';
|
|
8
9
|
import { join } from 'node:path';
|
|
9
10
|
import { boardUrl, configDir, parseEnvFile, readSetting } from './settings.js';
|
|
10
11
|
|
|
11
|
-
/** The
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
/** The git root of the current folder, or null outside a repository. */
|
|
13
|
+
function gitRoot() {
|
|
14
|
+
try {
|
|
15
|
+
return (
|
|
16
|
+
execFileSync('git', ['rev-parse', '--show-toplevel'], {
|
|
17
|
+
encoding: 'utf8',
|
|
18
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
19
|
+
}).trim() || null
|
|
20
|
+
);
|
|
21
|
+
} catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The project's root: as Claude Code gives it to hooks, and where it doesn't (a cloud session can leave
|
|
28
|
+
* CLAUDE_PROJECT_DIR empty, BRK-88), the git root of the folder the hook runs in, where `tasks claim` marks the task.
|
|
29
|
+
*/
|
|
30
|
+
export function projectRoot(env = process.env, root = gitRoot, cwd = process.cwd()) {
|
|
31
|
+
return env.CLAUDE_PROJECT_DIR || root() || cwd;
|
|
14
32
|
}
|
|
15
33
|
|
|
16
34
|
/** A file's text, or null when it can't be read. */
|
package/src/cli-version.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* bump CLI_VERSION and set CLI_FINGERPRINT to the value it prints. Constants only: the board's Worker imports it,
|
|
6
6
|
* so it lives in the board's package (CLD-135) and the CLI imports it from here.
|
|
7
7
|
*/
|
|
8
|
-
export const CLI_VERSION =
|
|
9
|
-
export const CLI_FINGERPRINT = '
|
|
8
|
+
export const CLI_VERSION = 41;
|
|
9
|
+
export const CLI_FINGERPRINT = 'f527cead53066a35';
|