zodiac/bin/zod.template

25 lines
603 B
Plaintext
Raw Normal View History

2011-09-22 17:28:24 +02:00
#!/bin/sh
# ZODIAC - a simple static site generator
2011-09-22 17:43:18 +02:00
# Copyright (c) 2011 Chase Allen James <nx-zodiac@nu-ex.com>
2011-09-22 17:28:24 +02:00
2011-10-06 23:49:17 +02:00
zod_lib=ZODLIB_PATH
proj=$1
target=$2
2011-09-22 17:28:24 +02:00
_zod_error() {
echo -e ">>> ERROR: $*" >&2
exit 1
}
2011-09-22 17:28:24 +02:00
[ "$#" -ne 2 ] && { echo "usage: zod projectdir targetdir"; exit; }
2011-10-06 23:49:17 +02:00
[ ! -d "$proj" ] && _zod_error "project directory does not exist"
[ ! -d "$target" ] && _zod_error "target directory does not exist"
2011-09-22 17:28:24 +02:00
2011-10-06 23:49:17 +02:00
find "$proj" -type f \
! -name "*.layout" \
! -name "*.meta" \
! -name "helpers.awk" \
2011-10-06 23:49:17 +02:00
-exec zod_render $zod_lib $proj $target {} \;