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

This commit is contained in:
Zaiming (Stone) Shi 2022-03-14 15:32:58 +01:00
parent a1e7ece192
commit 02598feffc
1 changed files with 8 additions and 2 deletions

View File

@ -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