xtrm-tools 0.5.1 → 0.5.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.
@@ -41286,13 +41286,27 @@ async function launchWorktreeSession(opts) {
41286
41286
  if (await import_fs_extra12.default.pathExists(mainBeadsDir)) {
41287
41287
  const worktreePortFile = import_node_path5.default.join(worktreeBeadsDir, "dolt-server.port");
41288
41288
  (0, import_node_child_process2.spawnSync)("bd", ["dolt", "stop"], { cwd: worktreePath, stdio: "pipe" });
41289
+ let mainPort = null;
41289
41290
  if (await import_fs_extra12.default.pathExists(mainPortFile)) {
41290
- const mainPort = (await import_fs_extra12.default.readFile(mainPortFile, "utf8")).trim();
41291
+ mainPort = (await import_fs_extra12.default.readFile(mainPortFile, "utf8")).trim();
41292
+ } else {
41293
+ const statusResult = (0, import_node_child_process2.spawnSync)("bd", ["dolt", "status"], {
41294
+ cwd: repoRoot,
41295
+ stdio: "pipe",
41296
+ encoding: "utf8"
41297
+ });
41298
+ const portMatch = (statusResult.stdout ?? "").match(/Port:\s*(\d+)/);
41299
+ if (portMatch) {
41300
+ mainPort = portMatch[1];
41301
+ await import_fs_extra12.default.writeFile(mainPortFile, mainPort, "utf8");
41302
+ }
41303
+ }
41304
+ if (mainPort) {
41291
41305
  await import_fs_extra12.default.ensureDir(worktreeBeadsDir);
41292
41306
  await import_fs_extra12.default.writeFile(worktreePortFile, mainPort, "utf8");
41293
41307
  console.log(kleur_default.dim(` beads: redirected to main server (port ${mainPort})`));
41294
41308
  } else {
41295
- console.log(kleur_default.dim(" beads: no port file found in main checkout, skipping redirect"));
41309
+ console.log(kleur_default.dim(" beads: main Dolt server not running, worktree will use isolated db"));
41296
41310
  }
41297
41311
  }
41298
41312
  console.log(kleur_default.green(`