@jswork/ushell-module-git 1.0.68 → 1.0.70

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/index.sh CHANGED
@@ -8,7 +8,7 @@ source $ROOT_PATH/modules/07-git-rebase.sh
8
8
  source $ROOT_PATH/modules/11-lazygit.sh
9
9
  source $ROOT_PATH/modules/14-gr.sh
10
10
  source $ROOT_PATH/modules/15-ignore-file.sh
11
- # source $ROOT_PATH/modules/16-wt.sh
11
+ source $ROOT_PATH/modules/16-wt.sh
12
12
 
13
13
  ## git base:
14
14
  alias gl='git pull'
package/modules/16-wt.sh CHANGED
@@ -1,38 +1,33 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # wtt CLI - Git Worktree Directory Switching (wtt = worktree-tool)
4
- # https://github.com/yourusername/worktree-cli
3
+ # wt CLI - Git Worktree Directory Switching
4
+ # Shell function for true directory switching with wt binary
5
5
 
6
6
  # Check if wt binary exists
7
7
  if command -v wt >/dev/null 2>&1; then
8
8
 
9
- # Find the actual wt binary path
9
+ # Store the actual wt binary path to avoid recursion
10
10
  WT_BIN=$(command -v wt)
11
11
 
12
- # 🚀 wtt function for true directory switching
13
- # wtt (worktree-tool) provides directory switching without conflicting with wt binary
14
- wtt() {
12
+ # wt function for directory switching
13
+ wt() {
15
14
  case "$1" in
16
15
  switch|co)
17
- # Handle switch/co commands for true directory switching
18
16
  shift
19
- local wt_cli="$WT_BIN" # Use the actual binary path
20
-
21
- # Get the path from wt switch command
22
17
  local path
23
- path=$($wt_cli switch "$@" 2>/dev/null)
18
+ path=$($WT_BIN switch "$@" 2>/dev/null)
24
19
 
25
- # Check if we got a valid path (absolute path starts with /)
20
+ # Check if we got a valid path
26
21
  if [[ "$path" = /* ]] && [[ -d "$path" ]]; then
27
22
  cd "$path" || return 1
28
23
  echo "✅ Switched to: $path"
29
24
  else
30
- # Let the original command handle errors and display
31
- $wt_cli switch "$@"
25
+ # Show errors from the binary
26
+ $WT_BIN switch "$@"
32
27
  fi
33
28
  ;;
34
29
  *)
35
- # Pass all other commands to wt binary (use full path to avoid recursion)
30
+ # Pass all other commands to wt binary
36
31
  "$WT_BIN" "$@"
37
32
  ;;
38
33
  esac
@@ -40,9 +35,9 @@ if command -v wt >/dev/null 2>&1; then
40
35
 
41
36
  else
42
37
  # wt binary not found - show installation message once
43
- if [[ -z "$WTT_SHOWN_MISSING" ]]; then
38
+ if [[ -z "$WT_SHOWN_MISSING" ]]; then
44
39
  echo "⚠️ wt CLI not found in PATH"
45
40
  echo "Install: go build -o wt main.go && sudo mv wt /usr/local/bin/wt"
46
- export WTT_SHOWN_MISSING=1
41
+ export WT_SHOWN_MISSING=1
47
42
  fi
48
43
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/ushell-module-git",
3
- "version": "1.0.68",
3
+ "version": "1.0.70",
4
4
  "description": "Unix like shell module for git.",
5
5
  "main": "index.sh",
6
6
  "repository": {