Add a function to perform automatic parameter substitution for new modules.

This commit is contained in:
Laurence Withers 2006-07-25 19:28:20 +01:00
parent e1de1ce843
commit 6a5f7bb01f
1 changed files with 16 additions and 0 deletions

View File

@ -43,6 +43,22 @@ then
exit 1 exit 1
fi fi
# function used to replace variables
# assumes that we're in the directory to replace files in
# for each argument X, it will replace @X@ with ${X}
do_parameter_subst() {
do_cmd source ~/.lwbuildrc || exit 1
for param in AUTHOR EMAIL VIM_MODELINE KATE_MODELINE $@
do
seds="${seds} -e s,@${param}@,${!param},g"
done
do_cmd find . -type f -exec sed ${seds} -i {} \; || exit 1
}
source ${TEMPLATE}/instantiate source ${TEMPLATE}/instantiate