Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit d6ffc35

Browse files
committed
Upgrade Doctum and improve script
1 parent d306231 commit d6ffc35

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

scripts/make-documentation.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,44 @@
33
set -e
44

55
REPOSITORY_ROOT="$(dirname $0)/../"
6-
BUILD_ROOT="${REPOSITORY_ROOT}/build"
6+
BUILD_ROOT="$(realpath ${REPOSITORY_ROOT}/build)"
77

88
function 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

1314
function 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

2930
function 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+
3744
checkRelease
3845

3946
buildDocumentation

0 commit comments

Comments
 (0)