@solaqua/gji 0.1.0-beta.3 → 0.1.0-beta.4

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/dist/go.js CHANGED
@@ -2,6 +2,7 @@ import { SelectPrompt, isCancel as isCoreCancel } from '@clack/core';
2
2
  import { isCancel, select } from '@clack/prompts';
3
3
  import { listWorktrees } from './repo.js';
4
4
  const GO_TTY_PROMPT_ENV = 'GJI_GO_TTY_PROMPT';
5
+ const GO_TTY_TARGET_PREFIX = '__GJI_TARGET__:';
5
6
  export function createGoCommand(dependencies = {}) {
6
7
  const promptForCapturedOutput = dependencies.promptForCapturedOutputWorktree ?? promptForCapturedOutputWorktree;
7
8
  const prompt = dependencies.promptForWorktree ?? promptForWorktree;
@@ -23,7 +24,10 @@ export function createGoCommand(dependencies = {}) {
23
24
  options.stderr('Aborted\n');
24
25
  return 1;
25
26
  }
26
- options.stdout(`${chosenPath}\n`);
27
+ const output = shouldUseCapturedOutputPrompt(options)
28
+ ? `${GO_TTY_TARGET_PREFIX}${chosenPath}\n`
29
+ : `${chosenPath}\n`;
30
+ options.stdout(output);
27
31
  return 0;
28
32
  };
29
33
  }
package/dist/init.js CHANGED
@@ -56,7 +56,9 @@ gji() {
56
56
  fi
57
57
 
58
58
  local target
59
- target="$(GJI_GO_TTY_PROMPT=1 command gji go --print "$@")" || return $?
59
+ local output
60
+ output="$(GJI_GO_TTY_PROMPT=1 command gji go --print "$@")" || return $?
61
+ target="\${output##*__GJI_TARGET__:}"
60
62
  cd "$target" || return $?
61
63
  return 0
62
64
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solaqua/gji",
3
- "version": "0.1.0-beta.3",
3
+ "version": "0.1.0-beta.4",
4
4
  "description": "Git worktree CLI for fast context switching.",
5
5
  "license": "MIT",
6
6
  "author": "sjquant",