dgiot/scripts/find-apps.sh

27 lines
486 B
Bash
Raw Normal View History

2021-05-18 14:54:48 +08:00
#!/usr/bin/env bash
set -euo pipefail
# ensure dir
cd -P -- "$(dirname -- "$0")/.."
find_app() {
local appdir="$1"
find "${appdir}" -mindepth 1 -maxdepth 1 -type d
}
# append emqx application first
2021-06-16 19:53:21 +08:00
echo 'emqx'
2021-05-18 14:54:48 +08:00
find_app 'apps'
if [ -f 'EMQX_ENTERPRISE' ]; then
find_app 'lib-ee'
else
find_app 'lib-ce'
fi
## find directories in lib-extra
find_app 'lib-extra'
## find symlinks in lib-extra
find 'lib-extra' -mindepth 1 -maxdepth 1 -type l -exec test -e {} \; -print