Skip to main content

fish_functions/go.fish

1###############################################################################
2# When I'm in the Tailscale repos, I should use ./tool/go instead of
3# the vanilla version of Go.
4#
5# This function will remind me to use ./tool/go instead of vanilla Go.
6###############################################################################
8function go --description 'Remind me to use ./tool/go in Tailscale repos'
9 set ROOT $(git rev-parse --show-toplevel 2>/dev/null)
11 if test -n "$ROOT"; and test -f "$ROOT/tool/go"
12 set_color red
13 echo "You should use ./tool/go instead!" >&2
14 set_color normal
15 else
16 command go $argv
17 end
18end