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
|
|
|
|
|
2015-03-25 23:03:51 +01:00
|
|
|
if [[ -z ${QPACKAGE_ROOT} ]]
|
2014-04-03 13:59:51 +02:00
|
|
|
then
|
2015-03-25 23:03:51 +01:00
|
|
|
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
|
2015-03-25 23:03:51 +01:00
|
|
|
source ${QPACKAGE_ROOT}/scripts/qp_include.sh
|
2014-04-03 13:59:51 +02:00
|
|
|
|
2015-03-25 23:03:51 +01: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
|
|
|
|