# HG changeset patch # User Yasutaka Higa # Date 1391063743 -32400 # Node ID 635d8af3f79508ec8df88a7e79e62e5fe3431eb5 # Parent 5ceacb9a06c7e90a385fdb45f5a1da32042eb686 Fix build script, check command diff -r 5ceacb9a06c7 -r 635d8af3f795 build.sh --- a/build.sh Thu Jan 30 15:23:40 2014 +0900 +++ b/build.sh Thu Jan 30 15:35:43 2014 +0900 @@ -1,8 +1,32 @@ #/bin/sh +# definition + +command="slideshow" +template_option="-t s6syntax" target_filename="*.md" + +# functions + +command_check() { + if !(which ${command} >& /dev/null;) then + echo ${command} not found + exit + fi +} + +build() { + + ${command} build $1 -o `dirname $1` ${template_option} +} + + +# main + +command_check + target_list=`find . -name "${target_filename}"` for target in ${target_list}; do - slideshow build -t s6syntax ${target} -o `dirname ${target}` + build $target done