3
3
set -e
4
4
5
5
REPOSITORY_ROOT=" $( dirname $0 ) /../"
6
- BUILD_ROOT=" ${REPOSITORY_ROOT} /build"
6
+ BUILD_ROOT=" $( realpath $ {REPOSITORY_ROOT} /build) "
7
7
8
8
function downloadRelease() {
9
9
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"
11
12
}
12
13
13
14
function checkRelease() {
14
15
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
16
17
cd " ${BUILD_ROOT} /"
17
18
sha256sum --check --strict doctum.phar.sha256
18
19
cd - > /dev/null
19
20
if [ " $? " != " 0" ]; then
20
21
downloadRelease
21
22
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.'
23
24
fi
24
25
else
25
26
downloadRelease
26
27
fi
27
28
}
28
29
29
30
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"
31
32
find " ${REPOSITORY_ROOT} doc" -type f -name " .delete-me" -delete
32
33
rm " ${REPOSITORY_ROOT} doc/renderer.index"
33
34
rm " ${REPOSITORY_ROOT} doc/PROJECT_VERSION"
34
35
rm " ${REPOSITORY_ROOT} doc/DOCTUM_VERSION"
35
36
}
36
37
38
+ echo " Using build root: ${BUILD_ROOT} "
39
+
40
+ if [ ! -d ${BUILD_ROOT} ]; then
41
+ mkdir ${BUILD_ROOT}
42
+ fi
43
+
37
44
checkRelease
38
45
39
46
buildDocumentation
0 commit comments