Skip to content

Commit

Permalink
Check if all the external commands needed are exist
Browse files Browse the repository at this point in the history
  • Loading branch information
neo954 committed Mar 25, 2024
1 parent 87d7d70 commit 8ebd03a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions latex/tinker-index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ then
exit 1
fi

# Check if all the external commands needed are exist
for cmd in awk md5sum cp
do
! type "${cmd}" >/dev/null 2>&1 &&
echo "${0##*/}: Command \"${cmd}\" not found" >&2 &&
exit 1
done
unset cmd

KEYWORD=""
PAGE=""

Expand Down Expand Up @@ -1027,6 +1036,7 @@ function encode_char()

echo "Tinker index file ${INDEX_FILE} ..."

# When the MD5 checksum matched, just copy the saved processed version
[ -f "${INDEX_MD5}" ] &&
md5sum -c "${INDEX_MD5}" &&
[ -f "${INDEX_CACHE}" ] &&
Expand Down

0 comments on commit 8ebd03a

Please sign in to comment.