Translation update done using Pootle.
[phpmyadmin-themes.git] / libraries / transformations / generator.sh
blob034d0f020dd5da7ac528ddad8f8132e374c28b9a
1 #!/bin/bash
3 # Shell script that adds a new function file using a template. Should not be called directly
4 # but instead by template_Generator.sh and template_generator_mimetype.sh
7 # $1: Template
8 # $2: Filename
9 # $3: (optional) Description
11 if [ $# == 0 ]
12 then
13 echo "Please call template_generator.sh or template_generator_mimetype.sh instead"
14 echo ""
15 exit 65
17 functionupper="`echo $2 | tr [:lower:] [:upper:]`"
18 functionlower="`echo $2 | tr [:upper:] [:lower:]`"
20 sed "s/\[ENTER_FILENAME_HERE\]/$functionupper/; s/\[enter_filename_here\]/$functionlower/; s/Description of the transformation./$3/;" < $1 > $2.inc.php
22 echo "Created $2.inc.php"
23 echo ""