@susu-eng/trunk-sync 2.3.3 → 2.4.0
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/commands/config.js
CHANGED
|
@@ -2,6 +2,7 @@ import { readFileSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
const USAGE = `Usage: trunk-sync config Show all config
|
|
5
|
+
trunk-sync config <key> Get a value
|
|
5
6
|
trunk-sync config <key>=<value> Set a value
|
|
6
7
|
trunk-sync config --unset <key> Remove a key
|
|
7
8
|
|
|
@@ -73,8 +74,15 @@ export function configCommand(args) {
|
|
|
73
74
|
const arg = positional[0];
|
|
74
75
|
const eq = arg.indexOf("=");
|
|
75
76
|
if (eq === -1) {
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
// Single key — read its value
|
|
78
|
+
const map = readConfig();
|
|
79
|
+
const value = map.get(arg);
|
|
80
|
+
if (value === undefined) {
|
|
81
|
+
console.error(`Key not found: ${arg}`);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
console.log(value);
|
|
85
|
+
return;
|
|
78
86
|
}
|
|
79
87
|
const key = arg.slice(0, eq);
|
|
80
88
|
const value = arg.slice(eq + 1);
|
package/dist/commands/seance.js
CHANGED
|
@@ -70,7 +70,10 @@ function rewindTranscript(transcriptPath, commitTimestamp, worktreePath) {
|
|
|
70
70
|
const expandedPath = transcriptPath.replace(/^~/, process.env.HOME || "~");
|
|
71
71
|
if (!existsSync(expandedPath))
|
|
72
72
|
return null;
|
|
73
|
-
|
|
73
|
+
// Git timestamps have second precision; transcript timestamps have millisecond
|
|
74
|
+
// precision. Adding 999ms includes the full second of the commit so we don't
|
|
75
|
+
// cut off transcript entries that fall within the same second as the commit.
|
|
76
|
+
const cutoff = new Date(commitTimestamp).getTime() + 999;
|
|
74
77
|
const lines = readFileSync(expandedPath, "utf-8").split("\n").filter(Boolean);
|
|
75
78
|
// Find the last line whose timestamp is <= the commit timestamp.
|
|
76
79
|
let cutIndex = -1;
|
package/package.json
CHANGED