# HG changeset patch # User Yasutaka Higa # Date 1391176726 -32400 # Node ID 455db4624bce1b87e35e7b976f01a3e5eedc3b71 # Parent 8cd28e3368fd89f1a55662fe7835d6aa8c925507 Check update on build diff -r 8cd28e3368fd -r 455db4624bce build.sh --- a/build.sh Fri Jan 31 19:20:25 2014 +0900 +++ b/build.sh Fri Jan 31 22:58:46 2014 +0900 @@ -12,6 +12,21 @@ fi } +slide_name_from_full_path() { + echo $1 | sed -e 's/.[^.]*$/.html/' +} + + +need_build() { + slide_name=`slide_name_from_full_path $1` + + if [ "${slide_name}" -ot "$1" ]; then + return 0 # if exist slide and newer than src, not needed. + fi + + return 1 +} + build() { ${build_command} build $1 -o `dirname $1` ${build_template_option} } @@ -19,7 +34,9 @@ build_slides() { target_list=`find "$(dirname $0)/${slide_root_dirname}" -name "${build_target_filename}"` for target in ${target_list}; do - build $target + if need_build $target; then + build $target + fi done } @@ -28,4 +45,3 @@ command_check build_slides -