You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ur...@apache.org on 2022/06/08 08:19:30 UTC

[pulsar-site] branch fix/build-script created (now 8e95f26ac10)

This is an automated email from the ASF dual-hosted git repository.

urfree pushed a change to branch fix/build-script
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


      at 8e95f26ac10 fix build script

This branch includes the following new commits:

     new 8e95f26ac10 fix build script

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[pulsar-site] 01/01: fix build script

Posted by ur...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

urfree pushed a commit to branch fix/build-script
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit 8e95f26ac102e0611bd209ce25bc51725305923f
Author: Li Li <ur...@apache.org>
AuthorDate: Wed Jun 8 16:19:22 2022 +0800

    fix build script
    
    Signed-off-by: Li Li <ur...@apache.org>
---
 site2/tools/build-site.sh | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/site2/tools/build-site.sh b/site2/tools/build-site.sh
index 2b8f8ae88de..f2f67b2d8b5 100755
--- a/site2/tools/build-site.sh
+++ b/site2/tools/build-site.sh
@@ -30,7 +30,7 @@ fi
 function workaround_crowdin_problem_by_copying_files() {
   # TODO: remove this after figuring out why crowdin removed code tab when generating translated files
   # https://github.com/apache/pulsar/issues/5816
-  node scripts/fix-tab.js 
+  node scripts/fix-tab.js
 }
 
 function crowdin() {
@@ -41,6 +41,7 @@ function crowdin() {
     # This leads to executing crowdin-upload and crowdin-download once per day when website build is scheduled
     # to run with cron expression '0 */6 * * *'
     CURRENT_HOUR=$(date +%H)
+    CURRENT_HOUR=${CURRENT_HOUR#0}
     if [[ "$CROWDIN_UPLOAD" == "1" || $CURRENT_HOUR -lt 6 ]]; then
       yarn run crowdin-upload
     fi
@@ -73,20 +74,21 @@ yarn
 if [ -n "$NEXT" ]; then
   yarn write-translations
   CURRENT_HOUR=$(date +%H)
+  CURRENT_HOUR=${CURRENT_HOUR#0}
   echo "------ crowdin envs:" "CROWDIN_UPLOAD: "$CROWDIN_UPLOAD "CROWDIN_DOWNLOAD: "$CROWDIN_DOWNLOAD "CURRENT_HOUR: "$CURRENT_HOUR
-  if [[ "$CROWDIN_UPLOAD" == "1" || $CURRENT_HOUR -eq 6 ]]; then
+  if [[ "$CROWDIN_UPLOAD" == "1" || $CURRENT_HOUR -lt 6 ]]; then
     echo "------ exec crowdin upload"
     yarn run crowdin-upload
-  else 
+  else
     echo "------ skip crowdin upload"
   fi
-  if [[ "$CROWDIN_DOWNLOAD" == "1" || $CURRENT_HOUR -eq 12 ]]; then
+  if [[ "$CROWDIN_DOWNLOAD" == "1" || $CURRENT_HOUR -gt 12 ]]; then
     echo "------ exec crowdin download"
     yarn crowdin-download
-    echo 'all' > scripts/.language
+    echo 'all' >scripts/.language
   else
     echo "------ skip crowdin download"
-    echo 'en' > scripts/.language
+    echo 'en' >scripts/.language
   fi
 
   node scripts/replace.js