Files
esp-idf-tools/custom_bin/changeesp.sh
T
2025-05-18 19:24:55 -06:00

26 lines
484 B
Bash

function getTargets() {
tmpFile='/tmp/targets.tmp'
idf.py --preview --list-targets > "$tmpFile"
tr '\n' ' ' < "$tmpFile"
rm "$tmpFile"
}
function subprocess() {
echo -e "\nChanging ESPTARGET\n"
echo -e "Set esp target (one of $(getTargets))"
read esp
eval "$1=$esp"
return 0
}
if [ ! -z "$1" ]; then
ret="$1"
else
ret=''
subprocess ret
fi
export ESPTARGET="${ret}"
echo -e "\nESPTARGET set to $ESPTARGET\n"
echo -e "\nAll done :3\n"