Skip to content

Commit 6d8ca65

Browse files
Test Userclaude
andcommitted
fix: auto-source when helper functions unavailable
The wt function now re-sources ~/.wt/wt.sh if helper functions are missing. Fixes usage in environments where only the main function is available but dependencies are not. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4ee3058 commit 6d8ca65

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

wt.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ _wt_update() {
733733
fi
734734
}
735735

736-
wt() {
736+
_wt_main() {
737737
_wt_setup_colors
738738
case "$1" in
739739
new) shift; _wt_new "$@" ;;
@@ -757,3 +757,10 @@ wt() {
757757
;;
758758
esac
759759
}
760+
761+
wt() {
762+
if ! type _wt_new &>/dev/null; then
763+
source "$HOME/.wt/wt.sh"
764+
fi
765+
_wt_main "$@"
766+
}

0 commit comments

Comments
 (0)