Skip to content

Commit f6a1f83

Browse files
committed
Add script to check for pandoc
1 parent 1bd1f0d commit f6a1f83

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tools/scripts/check_pandoc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Check whether pandoc is installed.
4+
#
5+
# Usage: check_pandoc
6+
#
7+
8+
# VARIABLES #
9+
10+
# Find pandoc:
11+
PANDOC=$(which pandoc 2>/dev/null)
12+
13+
14+
# FUNCTIONS #
15+
16+
# Prints usage information.
17+
usage() {
18+
echo '' >&2
19+
echo 'Usage: check_pandoc' >&2
20+
echo '' >&2
21+
}
22+
23+
# MAIN #
24+
25+
if [[ -x "${PANDOC}" ]] && "${PANDOC}" -v >/dev/null; then
26+
echo 'pandoc is installed.' >&2
27+
exit 0
28+
else
29+
echo 'ERROR: missing dependency. Please download pandoc (http://pandoc.org/). Once installed, run the command again.' >&2
30+
exit 1
31+
fi

0 commit comments

Comments
 (0)