2006-07-24 20:19:15 +01:00
|
|
|
if [ $# -ne 0 ]
|
|
|
|
then
|
|
|
|
print_failure "Too many arguments. None required for this module."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -e src/${NAME} ]
|
|
|
|
then
|
|
|
|
print_failure "src/${NAME} already exists."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Instantiating module src/${NAME}..."
|
|
|
|
|
|
|
|
do_cmd mkdir src/${NAME} || exit 1
|
|
|
|
do_cmd cp ${TEMPLATE}/* src/${NAME} || exit 1
|
|
|
|
|
2006-07-24 21:55:12 +01:00
|
|
|
do_cmd cd src/${NAME} || exit 1
|
|
|
|
do_cmd rm instantiate || exit 1
|
|
|
|
do_cmd find . -type f -exec sed -e "s,@NAME@,${NAME},g" -i {} \; || exit 1
|
|
|
|
do_cmd grep "@TODO@" * || exit 1
|
2006-07-24 20:19:15 +01:00
|
|
|
print_success "Module instantiated."
|
|
|
|
|
2006-07-24 21:55:12 +01:00
|
|
|
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
|
|
|
# vim: expandtab:ts=4:sw=4
|