@zenobius/pi-worktrees 0.5.0 → 0.5.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.
- package/README.md +1 -1
- package/dist/index.js +11 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -129,7 +129,7 @@ This creates a new Zellij tab with Neovim and Pi running in the new worktree pat
|
|
|
129
129
|
|
|
130
130
|
## Configuration
|
|
131
131
|
|
|
132
|
-
Settings live in `~/.pi/agent/pi-worktrees
|
|
132
|
+
Settings live in `~/.pi/agent/pi-worktrees.config.json`.
|
|
133
133
|
|
|
134
134
|
```json
|
|
135
135
|
{
|
package/dist/index.js
CHANGED
|
@@ -1705,7 +1705,10 @@ Valid keys: ${VALID_SETTING_KEYS.join(", ")}`, "error");
|
|
|
1705
1705
|
ctx.ui.notify(`${resolvedKey}: ${defaults[resolvedKey]}`, "info");
|
|
1706
1706
|
return;
|
|
1707
1707
|
}
|
|
1708
|
-
const
|
|
1708
|
+
const resolvedCurrent = deps.configService.current(ctx);
|
|
1709
|
+
const matchedPattern = resolvedCurrent.matchedPattern ?? "**";
|
|
1710
|
+
const configuredWorktrees = deps.configService.config.worktrees ?? {};
|
|
1711
|
+
const newSettings = { ...configuredWorktrees[matchedPattern] ?? {} };
|
|
1709
1712
|
if (value === "" || value === '""' || value === "null" || value === "clear") {
|
|
1710
1713
|
delete newSettings[resolvedKey];
|
|
1711
1714
|
delete newSettings.parentDir;
|
|
@@ -1717,7 +1720,13 @@ Valid keys: ${VALID_SETTING_KEYS.join(", ")}`, "error");
|
|
|
1717
1720
|
}
|
|
1718
1721
|
ctx.ui.notify(`\u2713 Set ${resolvedKey} = "${value}"`, "info");
|
|
1719
1722
|
}
|
|
1720
|
-
|
|
1723
|
+
const nextWorktrees = { ...configuredWorktrees, [matchedPattern]: newSettings };
|
|
1724
|
+
if (matchedPattern !== "**" && Object.keys(newSettings).length === 0) {
|
|
1725
|
+
delete nextWorktrees[matchedPattern];
|
|
1726
|
+
}
|
|
1727
|
+
try {
|
|
1728
|
+
await deps.configService.save({ worktrees: nextWorktrees });
|
|
1729
|
+
} catch (err) {
|
|
1721
1730
|
ctx.ui.notify(`Failed to save settings: ${err.message}`, "error");
|
|
1722
1731
|
}
|
|
1723
1732
|
}
|