@bobbyg603/mog 0.1.1 → 0.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobbyg603/mog",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "One command to go from GitHub issue to pull request, powered by Claude Code in a Docker sandbox",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
+ import { spawnSync } from "child_process";
3
4
  import { fetchIssue } from "./github";
4
5
  import { ensureRepo, createWorktree } from "./worktree";
5
6
  import { ensureSandbox, runClaude } from "./sandbox";
@@ -20,12 +21,10 @@ async function init() {
20
21
  } else {
21
22
  log.info(`Creating persistent sandbox '${SANDBOX_NAME}'...`);
22
23
  log.info(`Workspace: ${reposDir}`);
23
- const createProc = Bun.spawn(["docker", "sandbox", "create", "--name", SANDBOX_NAME, "claude", reposDir], {
24
- stdin: "inherit",
25
- stdout: "inherit",
26
- stderr: "inherit",
24
+ const createResult = spawnSync("docker", ["sandbox", "create", "--name", SANDBOX_NAME, "claude", reposDir], {
25
+ stdio: "inherit",
27
26
  });
28
- const createExit = await createProc.exited;
27
+ const createExit = createResult.status;
29
28
  if (createExit !== 0) {
30
29
  log.die("Failed to create sandbox.");
31
30
  }
@@ -36,12 +35,10 @@ async function init() {
36
35
  console.log();
37
36
  }
38
37
 
39
- const proc = Bun.spawn(["docker", "sandbox", "run", SANDBOX_NAME], {
40
- stdin: "inherit",
41
- stdout: "inherit",
42
- stderr: "inherit",
38
+ const runResult = spawnSync("docker", ["sandbox", "run", SANDBOX_NAME], {
39
+ stdio: "inherit",
43
40
  });
44
- const exitCode = await proc.exited;
41
+ const exitCode = runResult.status;
45
42
  if (exitCode !== 0) {
46
43
  log.die("Sandbox failed to run. Try 'docker sandbox ls' to check its status.");
47
44
  }
package/src/worktree.ts CHANGED
@@ -13,7 +13,7 @@ export async function ensureRepo(
13
13
  log.info(`Cloning ${repo} into ${repoDir}...`);
14
14
  fs.mkdirSync(`${reposDir}/${owner}`, { recursive: true });
15
15
 
16
- const clone = Bun.spawnSync(["gh", "repo", "clone", repo, repoDir], {
16
+ const clone = Bun.spawnSync(["gh", "repo", "clone", repo, repoDir, "--", "--recurse-submodules"], {
17
17
  stdout: "inherit",
18
18
  stderr: "inherit",
19
19
  });
@@ -86,6 +86,9 @@ export async function createWorktree(
86
86
  }
87
87
  }
88
88
 
89
+ // Init submodules in the worktree if present
90
+ Bun.spawnSync(["git", "submodule", "update", "--init", "--recursive"], { cwd: worktreeDir });
91
+
89
92
  log.ok(`Worktree created at ${worktreeDir}`);
90
93
  return { worktreeDir, branchName };
91
94
  }