mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00
Revert "build-pdf: only build changed folders since last commit" (#11795)
Revert "build-pdf: only build changed folders since last commit (#11773)"
This reverts commit 1de7b5a80b
.
This commit is contained in:
parent
1de7b5a80b
commit
10e2c5b145
1 changed files with 4 additions and 21 deletions
25
scripts/pdf/build-pdf.sh
Executable file → Normal file
25
scripts/pdf/build-pdf.sh
Executable file → Normal file
|
@ -7,6 +7,7 @@ set -ex
|
|||
function process_page {
|
||||
pageDir="$1"
|
||||
folder=$(basename "${pageDir}")
|
||||
language="${folder##*.}"
|
||||
case $folder in
|
||||
pages.bn | pages.ja | pages.ko | pages.ml | pages.ta | pages.th | pages.zh | pages.zh_TW)
|
||||
;;
|
||||
|
@ -14,32 +15,14 @@ function process_page {
|
|||
python3 render.py "${pageDir}" -c solarized-light
|
||||
;;
|
||||
*)
|
||||
language="${folder##*.}"
|
||||
python3 render.py "${pageDir}" -c basic -o "tldr-book-${language}.pdf"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function main {
|
||||
type="$1"
|
||||
case $type in
|
||||
"all")
|
||||
pageDirs=(../../pages*)
|
||||
;;
|
||||
*)
|
||||
changedFiles=$(git diff-tree --no-commit-id --name-only -r "$(git rev-parse HEAD)")
|
||||
changedPageDirs=$(echo "$changedFiles" | awk -F/ '/^(pages[^\/]+|pages)\//{print $1}' | sort -u)
|
||||
|
||||
if [ -z "$changedPageDirs" ]; then
|
||||
pageDirs=()
|
||||
else
|
||||
mapfile -t pageDirs <<< "$changedPageDirs"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
for pageDir in "${pageDirs[@]}"; do
|
||||
process_page "../../${pageDir}"
|
||||
for pageDir in ../../pages*; do
|
||||
process_page "${pageDir}"
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -47,4 +30,4 @@ function main {
|
|||
# MAIN
|
||||
###################################
|
||||
|
||||
main $1
|
||||
main
|
||||
|
|
Loading…
Add table
Reference in a new issue