Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check dependencies in Ebook gen script #406

Merged
merged 1 commit into from
Jul 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion generate-epub.sh
Original file line number Diff line number Diff line change
@@ -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