@susu-eng/trunk-sync 2.3.4 → 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/package.json
CHANGED