esp-idf/tools/unit-test-app/tools/get_available_configs.sh
Ivan Grokhotkov e94288da31 global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs
Using the method from @cemeyer
(https://github.com/espressif/esp-idf/pull/3166):

find . -name \*.sh -exec sed -i "" -e 's|^#!.*bin/bash|#!/usr/bin/env bash|' {} +

Closes https://github.com/espressif/esp-idf/pull/3166.
2020-04-03 01:10:02 +02:00

33 lines
868 B
Bash
Executable File

#!/usr/bin/env bash
cd ${IDF_PATH}/tools/unit-test-app
AVAL_CONFIGS=""
CONFIGS=$(ls configs)
if [ $1 == "esp32" ]; then
#echo 'Searching for configs for target "'$1'"'
for FILE in $CONFIGS
do
grep 'CONFIG_IDF_TARGET' <configs/$FILE > /dev/null
if [ $? -ne 0 ]; then
# If CONFIG_IDF_TARGET not found, implies ESP32
AVAL_CONFIGS="$AVAL_CONFIGS $FILE"
fi
grep -E '^CONFIG_IDF_TARGET="?'$1'"?$' <configs/$FILE > /dev/null
if [ $? -eq 0 ]; then
AVAL_CONFIGS="$AVAL_CONFIGS $FILE"
fi
done
else
#echo 'Searching for configs for target "'$1'"'
for FILE in $CONFIGS
do
grep -E '^CONFIG_IDF_TARGET="?'$1'"?$' <configs/$FILE > /dev/null
if [ $? -eq 0 ]; then
AVAL_CONFIGS="$AVAL_CONFIGS $FILE"
fi
done
fi
echo $AVAL_CONFIGS