chore(ci): stop depending on git in `check-example-configs.sh`

This commit is contained in:
Andrew Mayorov 2023-10-13 00:10:46 +07:00
parent 397686fd18
commit d0dac25644
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
PROJ_DIR="$(git rev-parse --show-toplevel)"
cd -P -- "$(dirname -- "$0")/../.."
PROFILE="${PROFILE:-emqx}" PROFILE="${PROFILE:-emqx}"
DIR_NAME='examples' DIR_NAME='examples'
@ -11,7 +12,7 @@ if [ "${PROFILE}" = 'emqx-enterprise' ]; then
SCHEMA_MOD='emqx_enterprise_schema' SCHEMA_MOD='emqx_enterprise_schema'
fi fi
IFS=$'\n' read -r -d '' -a FILES < <(find "${PROJ_DIR}/rel/config/${DIR_NAME}" -name "*.example" 2>/dev/null | sort && printf '\0') IFS=$'\n' read -r -d '' -a FILES < <(find "rel/config/${DIR_NAME}" -name "*.example" 2>/dev/null | sort && printf '\0')
prepare_erl_libs() { prepare_erl_libs() {
local libs_dir="$1" local libs_dir="$1"
@ -30,7 +31,7 @@ prepare_erl_libs() {
} }
# This is needed when checking schema # This is needed when checking schema
export EMQX_ETC_DIR="${PROJ_DIR}/apps/emqx/etc" export EMQX_ETC_DIR="apps/emqx/etc"
prepare_erl_libs "_build/$PROFILE/lib" prepare_erl_libs "_build/$PROFILE/lib"