Clone once (#52)

Closes #30
Closes #31
Closes #42

Rather than partially cloning, instead we clone once and then `clean` (to remove generated files), `reset` (to reset changed files), and `checkout` branches as needed. This should allow the outdated translation check to continue to work while also reducing build times significantly.

Before:
![before](/attachments/07c16ef5-110c-451a-9f1b-79f2c8b72caf)

After:
![after](/attachments/d6251f63-087d-4270-946f-63148b8f642a)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/52
Co-authored-by: John Olheiser <[email protected]>
Co-committed-by: John Olheiser <[email protected]>
This commit is contained in:
John Olheiser
2023-07-28 05:52:35 +00:00
committed by Lunny Xiao
parent 30a23a1ee4
commit 53e27a0e86
2 changed files with 27 additions and 33 deletions
+3 -7
View File
@@ -1,9 +1,6 @@
#!/bin/bash
# The script takes two params:
# version: "latest" or a specific version number
# locale
# This script checks if a specific locale version of document is up to date with English version
# This script takes `locale` as a param and checks if a specific locale version of document is up to date with English version
# If latest commit timestamp of English version is greater than the specific locale version,
# The specific locale version document will be marked as outdated
@@ -17,10 +14,9 @@ SED_INPLACE() {
fi
}
version="$1"
locale="$2"
locale="$1"
cur_path=`pwd`
cd .tmp/upstream-docs-"$version"
cd .tmp/upstream-docs
for file in `find ./docs/content -name "*.${locale}.md"`; do
file_en="${file/.${locale}/.en-us}"