From 9d32075a70549246738fc05a10ae70e0f4b2d1ce Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Mon, 18 Aug 2025 21:57:10 -0600 Subject: [PATCH] jesus fucvk fix4es --- add-to-export-sh.txt | 13 +++++++------ custom_bin/changeport.sh | 8 ++++---- todo.txt | 4 +++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/add-to-export-sh.txt b/add-to-export-sh.txt index 2ab34e9..57cf37e 100644 --- a/add-to-export-sh.txt +++ b/add-to-export-sh.txt @@ -27,18 +27,19 @@ binDir="$ESPIDFTOOLS_INSTALLDIR/.custom_bin" echo -e "\nChecking for Serial Devices in dmesg\n" COUNTER=0 -devarr=() +# devarr=() +declare -a devarr for line in $(dmesg | tail -50 | grep -o -E "tty[A-Z]{3}[0-9]{0,2}" | sort -u); do echo -e "$COUNTER /dev/$line" devarr[$COUNTER]="/dev/$line" - COUNTER=$((COUNTER+1)) + COUNTER=$(($COUNTER+1)) done if [ $COUNTER -gt 0 ]; then echo -e "\nEnter TTY Number You'd Like:" read tty - ttyselect=${devarr[$tty]} -else + ttyselect="${devarr[$tty]}" +else echo -e "\nNo Serial Devices Found, Select one later with 'changeport'\n" fi @@ -47,9 +48,9 @@ read esp # echo -e "\nSetting environment variables\n" export PATH="$ESPIDFTOOLS_INSTALLDIR/.custom_bin:$PATH" -export ESPPORT=$ttyselect +export ESPPORT="$ttyselect" export ESPBAUD=460800 -export ESPTARGET=$esp +export ESPTARGET="$esp" export examples="$ESPIDFTOOLS_INSTALLDIR/esp-idf/examples" echo -e "Installation Variables:" diff --git a/custom_bin/changeport.sh b/custom_bin/changeport.sh index d7378d1..5e9bc94 100644 --- a/custom_bin/changeport.sh +++ b/custom_bin/changeport.sh @@ -7,19 +7,19 @@ function subprocess() { for line in $(dmesg | tail -50 | grep -o -E "tty[A-Z]{3}[0-9]{0,2}" | sort -u); do echo -e "$COUNTER /dev/$line" devarr+=("/dev/$line") - COUNTER=$((COUNTER+1)) + COUNTER=$(($COUNTER+1)) done if [ $COUNTER -gt 0 ]; then echo -e "\nEnter TTY Number You'd Like:" read tty - ttyselect=$devarr[$tty+1] + ttyselect="${devarr[$tty+1]}" else echo -e "\nNo Serial Devices Found, Select one later with 'changeport'\n" fi sel=$tty+1 - eval "$1=$devarr[$sel]" + eval "$1=${devarr[$sel]}" return 0 } @@ -31,7 +31,7 @@ else subprocess ret fi -export ESPPORT=$ret +export ESPPORT="$ret" echo -e "\nESPPORT set to $ESPPORT\n" echo -e "\nAll done :3\n" \ No newline at end of file diff --git a/todo.txt b/todo.txt index a94b64a..6799f22 100644 --- a/todo.txt +++ b/todo.txt @@ -30,4 +30,6 @@ uninstaller make uninstaller interactive by default to make sure of paths check envvars for info unset envvars if need be - option for default nuke \ No newline at end of file + option for default nuke +export + check for existance of esp model before allowing on export and changesp \ No newline at end of file