diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5891598 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +js/compiled_templates.js: $(wildcard templates/*.html) + node templates/compile.js $^ > $@ + +clean: + rm -f js/compiled_templates.js diff --git a/templates/compile.js b/templates/compile.js index b7bcd40..7b24c5d 100644 --- a/templates/compile.js +++ b/templates/compile.js @@ -10,4 +10,4 @@ for(var i = 2; i < process.argv.length; i++) { compiled += dust.compile(text, name) + '\n'; } -fs.writeFileSync(__dirname + '/../js/compiled_templates.js', compiled); \ No newline at end of file +process.stdout.write(compiled); diff --git a/templates/compile.sh b/templates/compile.sh deleted file mode 100755 index c976d93..0000000 --- a/templates/compile.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -dir="$( dirname "${BASH_SOURCE[0]}" )" -templatesDir="${dir}/../../templates" -if [ -d ${templatesDir} ] -then - node ${dir}/compile.js ${dir}/*.html ${templatesDir}/*.html -else - node ${dir}/compile.js ${dir}/*.html -fi