Add a function to perform automatic parameter substitution for new modules.
This commit is contained in:
		
							parent
							
								
									e1de1ce843
								
							
						
					
					
						commit
						6a5f7bb01f
					
				| 
						 | 
				
			
			@ -43,6 +43,22 @@ then
 | 
			
		|||
    exit 1
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue