worktree-launcher 1.5.0 → 1.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.
Files changed (2) hide show
  1. package/dist/index.js +21 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -831,11 +831,21 @@ function showAIToolSelector(branchName) {
831
831
  });
832
832
  list.focus();
833
833
  screen.render();
834
- list.on("select", (_item, index) => {
834
+ list.on("select", async (_item, index) => {
835
835
  const tool = index === 0 ? "claude" : index === 1 ? "codex" : null;
836
836
  form.destroy();
837
+ setStatus(`Selected: ${tool ?? "skip"}, creating worktree...`);
837
838
  screen.render();
838
- createNewWorktree(branchName, tool);
839
+ try {
840
+ await createNewWorktree(branchName, tool);
841
+ } catch (e) {
842
+ setStatus(`Error: ${e.message}`);
843
+ worktreeList.focus();
844
+ screen.render();
845
+ }
846
+ });
847
+ list.key(["enter"], () => {
848
+ list.emit("select", list.items[list.selected], list.selected);
839
849
  });
840
850
  list.key(["escape"], () => {
841
851
  form.destroy();
@@ -845,13 +855,21 @@ function showAIToolSelector(branchName) {
845
855
  }
846
856
  async function createNewWorktree(branchName, tool) {
847
857
  setStatus(`Creating ${branchName}...`);
858
+ screen.render();
848
859
  try {
849
860
  const worktreePath = getWorktreePath(mainRepoPath, branchName);
861
+ setStatus(`Path: ${worktreePath}`);
862
+ screen.render();
850
863
  await createWorktree(worktreePath, branchName);
864
+ setStatus(`Worktree created, copying .env...`);
865
+ screen.render();
851
866
  await copyEnvFiles(mainRepoPath, worktreePath);
867
+ setStatus(`Done! Refreshing list...`);
868
+ screen.render();
852
869
  await refreshWorktrees();
853
870
  setStatus(`Created ${branchName}`);
854
871
  worktreeList.focus();
872
+ screen.render();
855
873
  if (tool) {
856
874
  await launchInWorktree(worktreePath, tool);
857
875
  }
@@ -946,7 +964,7 @@ async function deleteSelected() {
946
964
 
947
965
  // src/index.ts
948
966
  var program = new Command();
949
- program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.5.0").action(async () => {
967
+ program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.5.2").action(async () => {
950
968
  await interactiveCommand();
951
969
  });
952
970
  program.command("new <branch-name>").description("Create a new worktree and launch AI assistant").option("-i, --install", "Run package manager install after creating worktree").option("-s, --skip-launch", "Create worktree without launching AI assistant").option("-p, --push", "Push branch to remote (visible on GitHub)").action(async (branchName, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worktree-launcher",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "CLI tool for managing git worktrees with AI coding assistants",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",