@4pm/cli 1.19.6 → 1.19.7

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -37611,6 +37611,11 @@ async function attachSubmodules(root, submodules, emit, createMissingBranch = fa
37611
37611
  }
37612
37612
  continue;
37613
37613
  }
37614
+ const abs = join6(root, dir2);
37615
+ if (existsSync4(abs)) {
37616
+ emit("submodule", `Removing placeholder ${dir2} before attaching the submodule\u2026`);
37617
+ await rm(abs, { recursive: true, force: true });
37618
+ }
37614
37619
  emit("submodule", `Adding submodule ${sub.url} \u2192 ${dir2}\u2026`);
37615
37620
  const b2 = (sub.branch ?? "").trim();
37616
37621
  if (b2 && createMissingBranch && !await ensureRemoteBranch(sub.url, b2, emit)) {
@@ -37653,8 +37658,13 @@ async function attachSubmodules(root, submodules, emit, createMissingBranch = fa
37653
37658
  }
37654
37659
  async function commitAndPushSubmodules(root, submodules, emit) {
37655
37660
  const dirs = submodules.map((s3) => (s3.subdir ?? "").trim()).filter(Boolean);
37661
+ const addPaths = [
37662
+ ...existsSync4(join6(root, ".gitmodules")) ? [".gitmodules"] : [],
37663
+ ...dirs.filter((d) => existsSync4(join6(root, d)))
37664
+ ];
37665
+ if (addPaths.length === 0) return;
37656
37666
  emit("submodule", "Committing .gitmodules\u2026");
37657
- await run2("git", ["add", ".gitmodules", ...dirs], { cwd: root, timeout: 6e4 });
37667
+ await run2("git", ["add", ...addPaths], { cwd: root, timeout: 6e4 });
37658
37668
  const staged = (await run2("git", ["diff", "--cached", "--name-only"], { cwd: root, timeout: 3e4 })).stdout.trim();
37659
37669
  if (!staged) return;
37660
37670
  const commitArgs = ["commit", "-m", "chore: add git submodules (4PM)"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4pm/cli",
3
- "version": "1.19.6",
3
+ "version": "1.19.7",
4
4
  "private": false,
5
5
  "description": "4PM CLI — drives Claude/Codex CLIs on AI worker machines (Node + TypeScript)",
6
6
  "license": "LicenseRef-4PM-Source-Available",