mirror of https://github.com/CrimsonTome/tldr.git
build-pdf: add the option to build a single language
parent
ebab29116d
commit
2397113710
|
@ -21,22 +21,24 @@ function process_page {
|
||||||
}
|
}
|
||||||
|
|
||||||
function main {
|
function main {
|
||||||
type="$1"
|
languageId="$1"
|
||||||
case $type in
|
if [ -z "$languageId" ]; then
|
||||||
"all")
|
changedFiles=$(git diff-tree --no-commit-id --name-only -r "$(git rev-parse HEAD)")
|
||||||
pageDirs=(../../pages*)
|
changedPageDirs=$(echo "$changedFiles" | awk -F/ '/^(pages[^\/]+|pages)\//{print $1}' | sort -u)
|
||||||
;;
|
if [ -z "$changedPageDirs" ]; then
|
||||||
*)
|
pageDirs=()
|
||||||
changedFiles=$(git diff-tree --no-commit-id --name-only -r "$(git rev-parse HEAD)")
|
else
|
||||||
changedPageDirs=$(echo "$changedFiles" | awk -F/ '/^(pages[^\/]+|pages)\//{print $1}' | sort -u)
|
mapfile -t pageDirs <<< "$changedPageDirs"
|
||||||
|
fi
|
||||||
if [ -z "$changedPageDirs" ]; then
|
else
|
||||||
pageDirs=()
|
case $languageId in
|
||||||
else
|
"all")
|
||||||
mapfile -t pageDirs <<< "$changedPageDirs"
|
pageDirs=(../../pages*)
|
||||||
fi
|
;;
|
||||||
;;
|
*)
|
||||||
esac
|
pageDirs=("pages.${languageId}")
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
for pageDir in "${pageDirs[@]}"; do
|
for pageDir in "${pageDirs[@]}"; do
|
||||||
process_page "../../${pageDir}"
|
process_page "../../${pageDir}"
|
||||||
|
|
Loading…
Reference in New Issue