Explorar o código

chore: make find-apps.sh able to print json

Zaiming (Stone) Shi %!s(int64=3) %!d(string=hai) anos
pai
achega
02598feffc
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  1. 8 2
      scripts/find-apps.sh

+ 8 - 2
scripts/find-apps.sh

@@ -17,5 +17,11 @@ find_app() {
     "$FIND" "${appdir}" -mindepth 1 -maxdepth 1 -type d
 }
 
-find_app 'apps'
-find_app 'lib-ee'
+CE="$(find_app 'apps')"
+EE="$(find_app 'lib-ee')"
+
+if [ "${1:-}" = 'json' ]; then
+    echo -e "${CE}\n${EE} " | xargs | tr -d '\n' | jq -R -s -c 'split(" ")'
+else
+    echo -e "${CE}\n${EE}"
+fi