zodiac/bin/zod.template
2011-10-06 17:52:34 -04:00

25 lines
613 B
Bash

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