-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgw-doctor
executable file
·46 lines (35 loc) · 901 Bytes
/
gw-doctor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env fish
function _gw-doctor_print_help
echo "usage: gw-doctor"
echo " options:"
echo " -h, --help: show this message"
end
function gw-doctor
argparse h/help -- $argv
or return
if set -ql _flag_help
echo "health check for this git worktree helper"
_gw-doctor_print_help
return 0
end
set -f needs_doctor false
for cmd in "git" "fzf" "awk" "rg"
set -f msg "Checking for $cmd..."
if not command -sq $cmd
set -f msg "$msg Error: not found."
set -f needs_doctor true
else
set -f msg "$msg OK."
end
echo $msg
end
echo "" # i'm a newline
if test $needs_doctor = true
echo "Please install the missing dependencies."
return 1
end
echo "All OK :-)"
return 0
end
gw-doctor $argv
# vim: set ft=fish