flowcollab 0.3.9 → 0.3.10
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/bin/comment.mjs +9 -2
- package/bin/decisions.mjs +8 -1
- package/package.json +1 -1
package/bin/comment.mjs
CHANGED
|
@@ -28,8 +28,15 @@ async function main() {
|
|
|
28
28
|
if (!raw || !body) die('Usage: flow-comment <task_id> "<body>" [--commit[=<sha>]]');
|
|
29
29
|
|
|
30
30
|
let commit;
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const hasEq = process.argv.some(a => a.startsWith('--commit='));
|
|
32
|
+
if (process.argv.includes('--commit') || hasEq) {
|
|
33
|
+
// B14: --commit= with an empty value is a typo, not "use HEAD". Bare --commit means HEAD.
|
|
34
|
+
if (hasEq) {
|
|
35
|
+
commit = arg('commit');
|
|
36
|
+
if (!commit) die('--commit= was given with no value. Use --commit (HEAD) or --commit=<sha>.');
|
|
37
|
+
} else {
|
|
38
|
+
commit = headSha();
|
|
39
|
+
}
|
|
33
40
|
if (!/^[0-9a-f]{7,64}$/i.test(commit)) die(`Invalid commit SHA: ${commit}`);
|
|
34
41
|
}
|
|
35
42
|
|
package/bin/decisions.mjs
CHANGED
|
@@ -50,7 +50,14 @@ async function list() {
|
|
|
50
50
|
|
|
51
51
|
async function watch(rawId) {
|
|
52
52
|
const interval = Math.max(1, Number(arg('interval')) || 5);
|
|
53
|
-
|
|
53
|
+
// B9: arg() returns '' (not undefined) for a valueless --timeout; treat empty/invalid
|
|
54
|
+
// as the default rather than Number('')===0 → "poll forever". --timeout=0 is still forever.
|
|
55
|
+
const rawTimeout = arg('timeout');
|
|
56
|
+
let timeout = 1800;
|
|
57
|
+
if (rawTimeout !== undefined && rawTimeout !== '') {
|
|
58
|
+
const n = Number(rawTimeout);
|
|
59
|
+
timeout = Number.isFinite(n) ? Math.max(0, n) : 1800;
|
|
60
|
+
}
|
|
54
61
|
|
|
55
62
|
// Resolve the prefix to a full UUID once, up front, while the decision is
|
|
56
63
|
// still pending (resolveTaskId can only resolve prefixes via the pending
|