33set -e
44
55REPOSITORY_ROOT=" $( dirname $0 ) /../"
6- BUILD_ROOT=" ${REPOSITORY_ROOT} /build"
6+ BUILD_ROOT=" $( realpath $ {REPOSITORY_ROOT} /build) "
77
88function downloadRelease() {
99 rm -f " ${BUILD_ROOT} /doctum.phar"
10- curl -# -o " ${BUILD_ROOT} /doctum.phar" -O https://doctum.long-term.support/releases/5.1/doctum.phar
10+ curl -# -o " ${BUILD_ROOT} /doctum.phar" -O https://doctum.long-term.support/releases/5/doctum.phar
11+ chmod +x " ${BUILD_ROOT} /doctum.phar"
1112}
1213
1314function checkRelease() {
1415 if [ -f " ${BUILD_ROOT} /doctum.phar" ]; then
15- curl -s -o " ${BUILD_ROOT} /doctum.phar.sha256" -O https://doctum.long-term.support/releases/5.1 /doctum.phar.sha256
16+ curl -s -o " ${BUILD_ROOT} /doctum.phar.sha256" -O https://doctum.long-term.support/releases/5/doctum.phar.sha256
1617 cd " ${BUILD_ROOT} /"
1718 sha256sum --check --strict doctum.phar.sha256
1819 cd - > /dev/null
1920 if [ " $? " != " 0" ]; then
2021 downloadRelease
2122 else
22- echo ' You are using the latest 5.1 release of Doctum.'
23+ echo ' You are using the latest 5.x.x release of Doctum.'
2324 fi
2425 else
2526 downloadRelease
2627 fi
2728}
2829
2930function buildDocumentation() {
30- php " ${BUILD_ROOT} /doctum.phar" update --ignore-parse-errors -vvv --force " ${REPOSITORY_ROOT} /scripts/doctum.php"
31+ " ${BUILD_ROOT} /doctum.phar" update --ignore-parse-errors -vvv --force " ${REPOSITORY_ROOT} /scripts/doctum.php"
3132 find " ${REPOSITORY_ROOT} doc" -type f -name " .delete-me" -delete
3233 rm " ${REPOSITORY_ROOT} doc/renderer.index"
3334 rm " ${REPOSITORY_ROOT} doc/PROJECT_VERSION"
3435 rm " ${REPOSITORY_ROOT} doc/DOCTUM_VERSION"
3536}
3637
38+ echo " Using build root: ${BUILD_ROOT} "
39+
40+ if [ ! -d ${BUILD_ROOT} ]; then
41+ mkdir ${BUILD_ROOT}
42+ fi
43+
3744checkRelease
3845
3946buildDocumentation
0 commit comments