@jswork/ushell-module-git 1.0.67 → 1.0.69
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/modules/16-wt.sh +13 -9
- package/package.json +1 -1
package/modules/16-wt.sh
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# wtt CLI - Git Worktree Directory Switching (wtt = worktree-tool)
|
|
4
4
|
# https://github.com/yourusername/worktree-cli
|
|
5
5
|
|
|
6
6
|
# Check if wt binary exists
|
|
@@ -9,9 +9,17 @@ if command -v wt >/dev/null 2>&1; then
|
|
|
9
9
|
# Find the actual wt binary path
|
|
10
10
|
WT_BIN=$(command -v wt)
|
|
11
11
|
|
|
12
|
-
# 🚀 wt function for true directory switching
|
|
13
|
-
#
|
|
12
|
+
# 🚀 wt/wtt function for true directory switching
|
|
13
|
+
# wt and wtt (worktree-tool) provide directory switching without conflicting with wt binary
|
|
14
14
|
wt() {
|
|
15
|
+
_wt_impl "$@"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
wtt() {
|
|
19
|
+
_wt_impl "$@"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
_wt_impl() {
|
|
15
23
|
case "$1" in
|
|
16
24
|
switch|co)
|
|
17
25
|
# Handle switch/co commands for true directory switching
|
|
@@ -38,15 +46,11 @@ if command -v wt >/dev/null 2>&1; then
|
|
|
38
46
|
esac
|
|
39
47
|
}
|
|
40
48
|
|
|
41
|
-
# Convenience alias
|
|
42
|
-
alias wtco='wt co' # Quick switch to worktree
|
|
43
|
-
alias wtl='wt switch --list' # List all worktrees
|
|
44
|
-
|
|
45
49
|
else
|
|
46
50
|
# wt binary not found - show installation message once
|
|
47
|
-
if [[ -z "$
|
|
51
|
+
if [[ -z "$WTT_SHOWN_MISSING" ]]; then
|
|
48
52
|
echo "⚠️ wt CLI not found in PATH"
|
|
49
53
|
echo "Install: go build -o wt main.go && sudo mv wt /usr/local/bin/wt"
|
|
50
|
-
export
|
|
54
|
+
export WTT_SHOWN_MISSING=1
|
|
51
55
|
fi
|
|
52
56
|
fi
|