changeset 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 198eeda53d23
files build.sh
diffstat 1 files changed, 25 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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