This commit is contained in:
Laurence Withers 2006-07-24 22:37:53 +01:00
parent 587981015f
commit 33cd0e4daf
1 changed files with 2 additions and 15 deletions

View File

@ -1,21 +1,9 @@
if [ $# -lt 1 ] if [ $# -ne 0 ]
then then
print_failure "Not enough arguments after module; need LIBS." print_failure "Unexpected extra parameters."
echo "LIBS are the library module names for these test programs."
exit 1 exit 1
fi fi
LIBS="$@"
for lib in ${LIBS}
do
if [ ! -e src/${lib} ]
then
print_failure "src/${lib} does not exist"
exit 1
fi
done
if [ -e src/${NAME} ] if [ -e src/${NAME} ]
then then
print_failure "src/${NAME} already exists." print_failure "src/${NAME} already exists."
@ -30,7 +18,6 @@ do_cmd cp ${TEMPLATE}/* src/${NAME} || exit 1
do_cmd cd src/${NAME} || exit 1 do_cmd cd src/${NAME} || exit 1
do_cmd rm instantiate || 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 find . -type f -exec sed -e "s,@NAME@,${NAME},g" -i {} \; || exit 1
do_cmd find . -type f -exec sed -e "s,@LIBS@,${LIBS},g" -i {} \; || exit 1
do_cmd grep "@TODO@" * || exit 1 do_cmd grep "@TODO@" * || exit 1
print_success "Module instantiated." print_success "Module instantiated."