Created
October 31, 2014 02:13
-
-
Save sharapeco/000cdff7b7efa7cc4179 to your computer and use it in GitHub Desktop.
check_commands.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# @param $1 = command | |
function command_exists() { | |
if type $1 > /dev/null 2>&1; then | |
return 1 | |
else | |
return 0 | |
fi | |
} | |
# @param $1 = command | |
# @param $2 = application name | |
function check_command() { | |
command_exists $1 | |
if [ $? -ne 1 ]; then | |
echo | |
echo "ERROR: $2 is not installed" | |
echo | |
exit 1 | |
fi | |
echo "$2 ... installed" | |
} | |
echo "================================================================" | |
echo " Checking commands" | |
echo "================================================================" | |
check_command perl "Perl" | |
check_command convert "ImageMagick" | |
check_command gs "GhostScript" | |
check_command platex "pLaTeX" | |
check_command dvipdfmx "dvipdfmx" | |
check_command ffmpeg "ffmpeg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment