From 02598feffc550250ecf68b4632e9a69aec423c60 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 14 Mar 2022 15:32:58 +0100 Subject: [PATCH] chore: make find-apps.sh able to print json --- scripts/find-apps.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/find-apps.sh b/scripts/find-apps.sh index 7a337f664..ca7e480ea 100755 --- a/scripts/find-apps.sh +++ b/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