From 798fd4ba27980210d4956292fbca40566c9aa8df Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Thu, 29 Aug 2024 00:52:23 +0000
Subject: [PATCH] update tool/store-helper/ss-launcher.

Signed-off-by: shenmo <jifengshenmo@outlook.com>
---
 tool/store-helper/ss-launcher | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/tool/store-helper/ss-launcher b/tool/store-helper/ss-launcher
index eae5f35..a347a3d 100755
--- a/tool/store-helper/ss-launcher
+++ b/tool/store-helper/ss-launcher
@@ -56,19 +56,23 @@ unset desktop_file_path
 }
 
 function scan_desktop_file(){
-unset desktop_file_path
-    for desktop_file_path in $(dpkg -L "$1" |grep /usr/share/applications/ | awk '/\.desktop$/ {print}'); do
-	if [ "$(cat $desktop_file_path | grep NoDisplay=true)" = "" ];then
-	echo "$desktop_file_path"
-	fi
+    unset desktop_file_path
+    local result=""
+    for desktop_file_path in $(dpkg -L "$1" | grep /usr/share/applications/ | awk '/\.desktop$/ {print}'); do
+        if [ "$(grep NoDisplay=true $desktop_file_path)" = "" ]; then
+            result+="$desktop_file_path,"
+        fi
     done
-	for desktop_file_path in $(dpkg -L "$1" |grep /opt/apps/$package_name/entries/applications | awk '/\.desktop$/ {print}'); do
-	if [ "$(cat $desktop_file_path | grep NoDisplay=true)" = "" ];then
-	echo "$desktop_file_path"
-	fi
+    for desktop_file_path in $(dpkg -L "$1" | grep /opt/apps/$package_name/entries/applications | awk '/\.desktop$/ {print}'); do
+        if [ "$(grep NoDisplay=true $desktop_file_path)" = "" ]; then
+            result+="$desktop_file_path,"
+        fi
     done
-
-
+    # 去掉最后一个逗号
+    if [ -n "$result" ]; then
+        result=${result%,}
+    fi
+    echo "$result"
 }
 
 function launch_app(){