-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathbuild-docs-rsync
executable file
·41 lines (29 loc) · 1.11 KB
/
build-docs-rsync
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
37
38
39
40
#!/bin/bash
# Update PhD
GIT_FETCH="git fetch --quiet origin"
GIT_RESET="git reset --quiet --hard origin/master"
cd /local/repos/phpdoc/phd
$GIT_FETCH && $GIT_RESET >/tmp/log-phd 2>&1
BASE_DIR=/local/repos/phpdoc-git
assertUpToDateRepo() {
if [ ! -d $BASE_DIR/$1 ]; then
git clone https://github.com/php/doc-$2.git $BASE_DIR/$1
fi
git -C $BASE_DIR/$1 fetch origin && git -C $BASE_DIR/$1 reset --hard origin/master > /tmp/log-git-$i 2>&1
}
langs=`php8.2 -r 'include "/local/mirrors/phpweb/include/languages.inc"; echo implode( " ", array_keys( $ACTIVE_ONLINE_LANGUAGES ) );'`;
if [ ! -d $BASE_DIR ]; then
mkdir $BASE_DIR;
fi
# Update the core module it self
assertUpToDateRepo doc-base base
# All translations depend on english being up2date
assertUpToDateRepo en en
cd $BASE_DIR
for i in $langs; do
# Update the translation files
assertUpToDateRepo $i $i
/bin/bash /local/systems/build-docs-lang-rsync $i >>/tmp/log-$i 2>&1;
done
# Build manual lookup db
php8.2 /local/systems/gen-phpweb-sqlite-db.php /local/mirrors/phpweb/backend/manual-lookup.sqlite /local/mirrors/phpweb /manual >/dev/null