-
Notifications
You must be signed in to change notification settings - Fork 25
/
cable-bible
22 lines (20 loc) · 926 Bytes
/
cable-bible
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
# This allows to open the online version of the Cable Bible, when the computer
# is connected to the Web, and the local version otherwise.
if [[ "$(uname -s)" = "Darwin" ]] ; then
if ping -c 1 amiaopensource.github.io >/dev/null 2>&1 ; then
cablebible_path='https://amiaopensource.github.io/cable-bible/'
else
cablebible_path=$(find /usr/local/Cellar/cable-bible -iname 'index.html' | sort -M | tail -n1)
fi
open "${cablebible_path}"
elif [[ "$(uname -s)" = "Linux" ]] ; then
if ping -c 1 amiaopensource.github.io >/dev/null 2>&1 ; then
cablebible_path='https://amiaopensource.github.io/cable-bible/'
else
cablebible_path=$(find ~/.linuxbrew/Cellar/cable-bible -iname 'index.html' | sort -M | tail -n1)
fi
xdg-open "${cablebible_path}"
else
echo "Please locate the 'cable-bible' folder, and open the 'index.html' file in a browser."
fi