comparison build.sh @ 10:455db4624bce

Check update on build
author Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
date Fri, 31 Jan 2014 22:58:46 +0900
parents e0c4a349c94f
children 9dca7035ab93
comparison
equal deleted inserted replaced
9:8cd28e3368fd 10:455db4624bce
10 echo ${build_command} not found 10 echo ${build_command} not found
11 exit 11 exit
12 fi 12 fi
13 } 13 }
14 14
15 slide_name_from_full_path() {
16 echo $1 | sed -e 's/.[^.]*$/.html/'
17 }
18
19
20 need_build() {
21 slide_name=`slide_name_from_full_path $1`
22
23 if [ "${slide_name}" -ot "$1" ]; then
24 return 0 # if exist slide and newer than src, not needed.
25 fi
26
27 return 1
28 }
29
15 build() { 30 build() {
16 ${build_command} build $1 -o `dirname $1` ${build_template_option} 31 ${build_command} build $1 -o `dirname $1` ${build_template_option}
17 } 32 }
18 33
19 build_slides() { 34 build_slides() {
20 target_list=`find "$(dirname $0)/${slide_root_dirname}" -name "${build_target_filename}"` 35 target_list=`find "$(dirname $0)/${slide_root_dirname}" -name "${build_target_filename}"`
21 for target in ${target_list}; do 36 for target in ${target_list}; do
22 build $target 37 if need_build $target; then
38 build $target
39 fi
23 done 40 done
24 } 41 }
25 42
26 43
27 # main 44 # main
28 45
29 command_check 46 command_check
30 build_slides 47 build_slides
31