-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild-api-reference
More file actions
executable file
·36 lines (31 loc) · 1.35 KB
/
build-api-reference
File metadata and controls
executable file
·36 lines (31 loc) · 1.35 KB
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
#!/bin/bash
#
# This file is part of the yannoff/console library
#
# (c) Yannoff (https://github.com/yannoff)
#
# @project yannoff/console
# @link https://github.com/yannoff/console
# @license https://github.com/yannoff/console/blob/master/LICENSE
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
DOC_ROOT=${1:-doc/api}
# Remove all documentation pages
rm -rf ${DOC_ROOT}/*
# Build classes documentation
env PHP_VERSION=7.2 phpdoc gen:pages --docs-root ${DOC_ROOT} --template class.md.twig --namespace Yannoff\\Component\\Console --exclude Yannoff\\Component\\Console\\Tests\\Command\\HelloCommand --exclude Yannoff\\Component\\Console\\Internal\\Version
# Build table of contents
env PHP_VERSION=7.2 phpdoc gen:index --docs-root ${DOC_ROOT} --template index.md.twig --namespace Yannoff\\Component\\Console --exclude Yannoff\\Component\\Console\\Tests\\Command\\HelloCommand --exclude Yannoff\\Component\\Console\\Internal\\Version
# Cleanup irrelevant updates
modified=( $(git status --porcelain ${DOC_ROOT} | awk '{ print $2; }') )
for f in "${modified[@]}"
do
# A 2-lines minimal diff means only generation date has changed
if [ "$(git min-diff $f | wc -l)" -eq "2" ]
then
echo -e "\033[01;30m-> Checking out file: $f\033[00m"
git checkout $f
fi
done