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

robin0716 pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git


The following commit(s) were added to refs/heads/dev by this push:
     new 498b094  chore: Sort and update plugin list in sync-info script
498b094 is described below

commit 498b09404ae37335900f786a9f39c52c0a40a1d8
Author: robin <[email protected]>
AuthorDate: Tue Aug 20 12:00:20 2024 +0800

    chore: Sort and update plugin list in sync-info script
---
 script/sync-info.sh | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/script/sync-info.sh b/script/sync-info.sh
index 48cb109..aa36cc4 100755
--- a/script/sync-info.sh
+++ b/script/sync-info.sh
@@ -35,13 +35,20 @@ done
 
 echo "{}" >"$project_root/plugins_desc.json"
 
-for dir in $(find "$project_root" -type d); do
-    if [[ "$dir" == *node_modules* ]] || [[ "$dir" == *.git* ]] || [[ "$dir" 
== *.vscode* ]]; then
+plugins=()
+for dir in "$project_root"/*/; do
+    if [[ "$dir" =~ (node_modules|util|script|.git|.vscode) ]]; then
         continue
     fi
+    plugins+=($(basename "$dir"))
+done
 
+plugins=($(printf '%s\n' "${plugins[@]}" | sort))
+
+for plugin in "${plugins[@]}"; do
     slug_name=""
     link=""
+    dir="$project_root/$plugin"
     if [ -f "$dir/info.yaml" ]; then
         slug_name=$(yq '.slug_name' "$dir/info.yaml")
         link=$(yq '.link' "$dir/info.yaml")
@@ -60,7 +67,7 @@ for dir in $(find "$project_root" -type d); do
                     if [ "$name" == "null" ] || [ "$description" == "null" ]; 
then
                         continue
                     fi
-                   
+
                     if [ -f "$project_root/plugins_desc.json" ]; then
                         if [ "$(jq ".$file_name" 
"$project_root/plugins_desc.json")" != "null" ]; then
                             jq ".$file_name += [{\"name\": \"$name\", 
\"desc\": \"$description\", \"link\": \"$link\"}]" 
"$project_root/plugins_desc.json" >"$project_root/plugins_desc.json.tmp"

Reply via email to