/
update_manual
executable file
·42 lines (42 loc) · 1.05 KB
/
update_manual
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
cwd=${PWD}
if [[ -z $1 ]]; then
arch=local
else
arch=$1
shift
fi
if [[ -z $1 ]]; then
version=psmp
else
version=$1
shift
fi
cp2kexe=${cwd}/../../exe/${arch}/cp2k.${version}
echo "CP2K executable: ${cp2kexe}"
version_string=$(${cp2kexe} -v | head -1)
if [[ -n $(echo ${version_string} | grep Development) ]]; then
version_string=trunk
else
version_string=$(echo "${version_string}" | awk '{print $3}')
fi
echo Update CP2K manual: ${version_string}
if [[ -z $1 ]]; then
mandir=${arch}/${version}
else
mandir=$1
shift
fi
echo "CP2K manual path: ${mandir}"
if [[ -s ${cp2kexe} ]]; then
[[ -d ${mandir} ]] && rm -rf ${mandir}
mkdir -p ${mandir}
cp collapsibleList.js cp2k_input.xsl cp2k_manual_logo.png cp2k_manual_logo.svg favicon.png favicon.svg toggle_folding.js xml2htm ../input_editing/vim/vim.xsl ${mandir}
cd ${mandir}
${cp2kexe} --xml
./xml2htm ${version_string}
echo "CP2K manual update done."
cd ${cwd} >/dev/null
else
echo "ERROR in $(basename $0): CP2K executable file ${cp2kexe} not found"
fi