comparison build.sh @ 2:635d8af3f795

Fix build script, check command
author Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
date Thu, 30 Jan 2014 15:35:43 +0900
parents 5ceacb9a06c7
children ab0287707334
comparison
equal deleted inserted replaced
1:5ceacb9a06c7 2:635d8af3f795
1 #/bin/sh 1 #/bin/sh
2 2
3 # definition
4
5 command="slideshow"
6 template_option="-t s6syntax"
3 target_filename="*.md" 7 target_filename="*.md"
8
9
10 # functions
11
12 command_check() {
13 if !(which ${command} >& /dev/null;) then
14 echo ${command} not found
15 exit
16 fi
17 }
18
19 build() {
20
21 ${command} build $1 -o `dirname $1` ${template_option}
22 }
23
24
25 # main
26
27 command_check
4 28
5 target_list=`find . -name "${target_filename}"` 29 target_list=`find . -name "${target_filename}"`
6 for target in ${target_list}; do 30 for target in ${target_list}; do
7 slideshow build -t s6syntax ${target} -o `dirname ${target}` 31 build $target
8 done 32 done