@bobbyg603/mog 0.1.0 → 0.1.2

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/package.json +1 -1
  2. package/src/index.ts +14 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobbyg603/mog",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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,7 +21,13 @@ async function init() {
20
21
  } else {
21
22
  log.info(`Creating persistent sandbox '${SANDBOX_NAME}'...`);
22
23
  log.info(`Workspace: ${reposDir}`);
23
- await run(["docker", "sandbox", "create", "--name", SANDBOX_NAME, "claude", reposDir]);
24
+ const createResult = spawnSync("docker", ["sandbox", "create", "--name", SANDBOX_NAME, "claude", reposDir], {
25
+ stdio: "inherit",
26
+ });
27
+ const createExit = createResult.status;
28
+ if (createExit !== 0) {
29
+ log.die("Failed to create sandbox.");
30
+ }
24
31
  log.ok("Sandbox created.");
25
32
  console.log();
26
33
  log.info("Launching sandbox — authenticate with /login to use your Max subscription.");
@@ -28,12 +35,13 @@ async function init() {
28
35
  console.log();
29
36
  }
30
37
 
31
- const proc = Bun.spawn(["docker", "sandbox", "run", SANDBOX_NAME], {
32
- stdin: "inherit",
33
- stdout: "inherit",
34
- stderr: "inherit",
38
+ const runResult = spawnSync("docker", ["sandbox", "run", SANDBOX_NAME], {
39
+ stdio: "inherit",
35
40
  });
36
- await proc.exited;
41
+ const exitCode = runResult.status;
42
+ if (exitCode !== 0) {
43
+ log.die("Sandbox failed to run. Try 'docker sandbox ls' to check its status.");
44
+ }
37
45
 
38
46
  log.ok("mog is ready. Run: mog <owner/repo> <issue_number>");
39
47
  }