Blame view

pma/libraries/transformations/generator.sh 663 Bytes
a1684257   Administrator   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  #!/bin/bash
  #
  # Shell script that adds a new function file using a template. Should not be called directly
  # but instead by template_Generator.sh and template_generator_mimetype.sh
  #
  #
  # $1: Template
  # $2: Filename
  # $3: (optional) Description
  
  if [ $# == 0 ]
  then
    echo "Please call template_generator.sh or template_generator_mimetype.sh instead"
    echo ""
    exit 65
  fi
  functionupper="`echo $2 | tr [:lower:] [:upper:]`"
  functionlower="`echo $2 | tr [:upper:] [:lower:]`"
  
  sed "s/\[ENTER_FILENAME_HERE\]/$functionupper/; s/\[enter_filename_here\]/$functionlower/; s/Description of the transformation./$3/;" < $1 > $2.inc.php
  
  echo "Created $2.inc.php"
  echo ""