lw-build-system/skel/scripts/build.c++.app/instantiate
Laurence Withers 9e8d1e4c15 WIP on module instantiation.
Rather than the skeleton dir shipping with a couple of ready-made
modules, one for each type of project, it would make much more sense and
be much more flexible to instead provide a script to instantiate modules
as needed.
2006-07-24 20:19:15 +01:00

21 lines
490 B
Text

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
do_cmd rm src/${NAME}/instantiate || exit 1
do_cmd find src/${NAME} -type f -exec sed -e "s,@NAME@,${NAME},g" -i {} \; || exit 1
print_success "Module instantiated."