#!/bin/bash # 1 - name # 2 - header of the page # 3 - description of the tool # 4 - directory with examples (existing one, to copy) # 5 - pyps print code module # TO DO advanced! EXPECTED_ARGS=4 OPTIONAL_ARGS=5 if [ $# -ne $EXPECTED_ARGS ] then if [ $# -ne $OPTIONAL_ARGS ] then echo "Usage: add_tool " return 1 fi fi validation="../../../../validation/Paws/tools/" source ../../bin/activate # new controller and new mako template python create_controller.py tool $1 python create_tool_template.py $1 "$2" # new tool validation directory with examples and description mkdir "${validation}$1" if [ $# -ne $OPTIONAL_ARGS ] then cp -r $5 ${validation} mv "${validation}$5" "${validation}$1" fi # new description file echo $3 > "${validation}${1}/${1}.txt" # new pyps module cp "templates/template.c" "${validation}/../pyps_modules/paws_${1}.c" python create_pyps_module.py $4 $1 mv "templates/paws_${1}.py" "${validation}/../pyps_modules/" deactivate