10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-09 15:43:54 +01:00
quantum_package/scripts/module/create_rst_templates.sh

44 lines
701 B
Bash
Raw Normal View History

2014-04-03 13:59:51 +02:00
#!/bin/bash
#
# Creates the rst files when creating a new module.
# Thu Apr 3 11:54:16 CEST 2014
if [[ -z ${QPACKAGE_ROOT} ]]
2014-04-03 13:59:51 +02:00
then
print "The QPACKAGE_ROOT environment variable is not set."
print "Please reload the quantum_package.rc file."
exit -1
2014-04-03 13:59:51 +02:00
fi
source ${QPACKAGE_ROOT}/scripts/qp_include.sh
2014-04-03 13:59:51 +02:00
check_current_dir_is_module
2015-04-10 19:32:35 +02:00
MODULE=$(basename $PWD)
2014-04-03 13:59:51 +02:00
2014-04-03 16:23:27 +02:00
README="True"
2014-04-03 13:59:51 +02:00
if [[ -f README.rst ]]
then
2014-04-03 16:23:27 +02:00
asksure "Overwrite existing README.rst file?" || README="False"
2014-04-03 13:59:51 +02:00
fi
UNDERLINE="======="
declare -i i=0
while [[ i -lt ${#MODULE} ]]
do
UNDERLINE+="="
i+=1
done
2014-04-03 16:23:27 +02:00
if [[ ${README} == "True" ]]
then
cat << EOF > ./README.rst
2014-04-03 13:59:51 +02:00
$UNDERLINE
$MODULE Module
$UNDERLINE
EOF
2014-04-03 16:23:27 +02:00
fi
touch ./ASSUMPTIONS.rst
2014-04-03 13:59:51 +02:00