Skip to content

Commit

Permalink
Check dependencies in Ebook gen script (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
sainadh-d committed Jul 4, 2020
1 parent d57b3d1 commit 6020231
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion generate-epub.sh
@@ -1,4 +1,4 @@
#! /usr/bin/env sh
#! /usr/bin/env bash

generate_from_stdin() {
outfile=$1
Expand Down Expand Up @@ -34,6 +34,20 @@ generate () {
cat $name.md | generate_from_stdin $name.epub $language
}

# Check if depencies exist
check_dependencies () {
for dependency in "${dependencies[@]}"
do
if ! [ -x "$(command -v $dependency)" ]; then
echo "Error: $dependency is not installed." >&2
exit 1
fi
done
}

dependencies=("pandoc")

check_dependencies
generate_with_solutions
generate README-ja ja
generate README-zh-Hans zh-Hans
Expand Down

0 comments on commit 6020231

Please sign in to comment.