]> Creatis software - bbtk.git/blob - kernel/appli/bbCreateBox/bbCreateBox.sh.in
*** empty log message ***
[bbtk.git] / kernel / appli / bbCreateBox / bbCreateBox.sh.in
1 #!/bin/bash
2 # creates the file architecture for a new user package
3
4 if [ $# -lt 3 ]
5     then
6     echo "usage : bbCreateBox <template-xml-file-name> <box-name> <package-name> [author] [description] [category]"  
7     exit
8 fi
9
10 # bbCreatePackage path
11 TMP=$(which $0|rev)
12 BINPATH=$(echo ${TMP#*/}|rev)
13 # Input data path
14 #INPUT=${BINPATH}/@bbCreateBox_DATA_REL_PATH_FROM_BIN@/$1
15 INPUT=$1
16
17 BBCB_BOX_NAME=$2
18 BBCB_PACKAGE_NAME=$3
19 BBCB_AUTHOR=$4
20 BBCB_DESCRIPTION=$5
21 BBCB_CATEGORY=$6
22
23 echo "input       = " $INPUT
24 echo "box name    = " $BBCB_BOX_NAME
25 echo "package     = " $BBCB_PACKAGE_NAME
26 echo "author      = " $BBCB_AUTHOR
27 echo "description = " $BBCB_DESCRIPTION
28 echo "category    = " $BBCB_CATEGORY
29
30 sed s,BBCB_BOX_NAME,"${BBCB_BOX_NAME}", < $INPUT | sed  s/BBCB_AUTHOR/"${BBCB_AUTHOR}"/ | sed s{BBCB_DESCRIPTION{"${BBCB_DESCRIPTION}"{ | sed s/BBCB_CATEGORY/"${BBCB_CATEGORY}"/ > bb${BBCB_PACKAGE_NAME}${BBCB_BOX_NAME}.xml
31
32