@jhorst11/wt 2.0.1 → 2.1.0
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/README.md +39 -3
- package/dist/bin/wt.d.ts +3 -0
- package/dist/bin/wt.d.ts.map +1 -0
- package/dist/bin/wt.js +83 -0
- package/dist/bin/wt.js.map +1 -0
- package/dist/src/commands.d.ts +9 -0
- package/dist/src/commands.d.ts.map +1 -0
- package/dist/src/commands.js +924 -0
- package/dist/src/commands.js.map +1 -0
- package/dist/src/config.d.ts +51 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +384 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/git.d.ts +55 -0
- package/dist/src/git.d.ts.map +1 -0
- package/dist/src/git.js +387 -0
- package/dist/src/git.js.map +1 -0
- package/dist/src/setup.d.ts +8 -0
- package/dist/src/setup.d.ts.map +1 -0
- package/dist/src/setup.js +245 -0
- package/dist/src/setup.js.map +1 -0
- package/dist/src/types.d.ts +64 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/ui.d.ts +93 -0
- package/dist/src/ui.d.ts.map +1 -0
- package/dist/src/ui.js +273 -0
- package/dist/src/ui.js.map +1 -0
- package/package.json +20 -6
- package/bin/wt.js +0 -87
- package/shell/wt.sh +0 -66
- package/src/commands.js +0 -883
- package/src/config.js +0 -257
- package/src/git.js +0 -397
- package/src/setup.js +0 -267
- package/src/ui.js +0 -147
package/shell/wt.sh
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Shell wrapper for wt-cli to enable directory changing
|
|
3
|
-
# Add this to your .bashrc or .zshrc:
|
|
4
|
-
# source /path/to/wt/shell/wt.sh
|
|
5
|
-
|
|
6
|
-
# Find the wt binary - works whether installed globally or locally
|
|
7
|
-
_wt_find_bin() {
|
|
8
|
-
if command -v wt &>/dev/null; then
|
|
9
|
-
echo "wt"
|
|
10
|
-
elif [[ -f "$HOME/.npm-global/bin/wt" ]]; then
|
|
11
|
-
echo "$HOME/.npm-global/bin/wt"
|
|
12
|
-
elif [[ -f "$(npm root -g 2>/dev/null)/wt-cli/bin/wt.js" ]]; then
|
|
13
|
-
echo "node $(npm root -g)/wt-cli/bin/wt.js"
|
|
14
|
-
else
|
|
15
|
-
echo "wt"
|
|
16
|
-
fi
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
wt() {
|
|
20
|
-
local wt_bin=$(_wt_find_bin)
|
|
21
|
-
local wt_cd_file="/tmp/wt_cd_$$"
|
|
22
|
-
|
|
23
|
-
# Clean up any old cd file
|
|
24
|
-
rm -f "$wt_cd_file"
|
|
25
|
-
|
|
26
|
-
# Run wt with env vars so it knows we can handle cd
|
|
27
|
-
WT_WRAPPER=1 WT_CD_FILE="$wt_cd_file" $wt_bin "$@"
|
|
28
|
-
local exit_code=$?
|
|
29
|
-
|
|
30
|
-
# Check if wt wrote a cd path
|
|
31
|
-
if [[ -f "$wt_cd_file" ]]; then
|
|
32
|
-
local dir=$(cat "$wt_cd_file")
|
|
33
|
-
rm -f "$wt_cd_file"
|
|
34
|
-
[[ -d "$dir" ]] && cd "$dir"
|
|
35
|
-
fi
|
|
36
|
-
|
|
37
|
-
return $exit_code
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
# Tab completion for bash
|
|
41
|
-
if [[ -n "$BASH_VERSION" ]]; then
|
|
42
|
-
_wt_completions() {
|
|
43
|
-
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
44
|
-
local commands="new list ls remove rm home go setup"
|
|
45
|
-
COMPREPLY=($(compgen -W "$commands" -- "$cur"))
|
|
46
|
-
}
|
|
47
|
-
complete -F _wt_completions wt
|
|
48
|
-
fi
|
|
49
|
-
|
|
50
|
-
# Tab completion for zsh
|
|
51
|
-
if [[ -n "$ZSH_VERSION" ]]; then
|
|
52
|
-
_wt_completions() {
|
|
53
|
-
local commands=(
|
|
54
|
-
'new:Create a new worktree'
|
|
55
|
-
'list:List all worktrees'
|
|
56
|
-
'ls:List all worktrees'
|
|
57
|
-
'remove:Remove a worktree'
|
|
58
|
-
'rm:Remove a worktree'
|
|
59
|
-
'home:Return to main repo'
|
|
60
|
-
'go:Jump to a worktree'
|
|
61
|
-
'setup:Configure shell integration'
|
|
62
|
-
)
|
|
63
|
-
_describe 'command' commands
|
|
64
|
-
}
|
|
65
|
-
compdef _wt_completions wt
|
|
66
|
-
fi
|