File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ Extra dependencies:
16
16
17
17
```
18
18
Usage:
19
- work switch interactive switcher, prints tree path
19
+ work interactive switcher, prints tree path
20
20
work i, init prepare cwd for work
21
21
work ls, list list work trees
22
22
work b, branch [name] switch current work tree to branch
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ function cwd_is_git_repo() {
27
27
function usage() {
28
28
cat << HEREDOC
29
29
Usage:
30
- $PROGRAM_NAME switch interactive switcher, prints tree path
30
+ $PROGRAM_NAME interactive switcher, prints tree path
31
31
$PROGRAM_NAME i, init prepare cwd for work
32
32
$PROGRAM_NAME ls, list list work trees
33
33
$PROGRAM_NAME b, branch [name] switch current work tree to branch
@@ -66,13 +66,13 @@ function handle_list() {
66
66
}
67
67
68
68
function handle_switch() {
69
- SELECTION=$( git worktree list | sed -r ' s/^(.*\/([^[:space:]]*))/\1 \2/g' | fzf --with-nth=2,4 --height 10 --border --prompt " tree: " )
69
+ SELECTION=$( git worktree list | sed -r ' s/^(.*\/([^[:space:]]* ))/\1 \2/g' | fzf --with-nth=2,4 --height 10 --border --prompt " tree: " )
70
70
if [ -z " $SELECTION " ]; then
71
71
exit 0
72
72
fi
73
73
DIR=$( cut -d" " -f1 <<< " $SELECTION" )
74
74
if [[ -f " $CWD_PARENT /hook.sh" ]]; then
75
- exec " $CWD_PARENT /hook.sh"
75
+ exec " $CWD_PARENT /hook.sh $DIR "
76
76
fi
77
77
echo " -> $DIR "
78
78
}
You can’t perform that action at this time.
0 commit comments