From 50839489e0749641425d5607df8da49c41f723f8 Mon Sep 17 00:00:00 2001 From: hPrnicessPi3 Date: Fri, 9 May 2025 14:57:56 -0600 Subject: [PATCH] more bugfixes --- .gitignore | 1 + custom_bin/changebaud.sh | 16 ++++++++-------- custom_bin/espinfo | 1 + custom_bin/help-esp-tools | 2 +- esp-idf-tools-cmd.sh | 9 +++++---- test-scratch.sh | 9 +++++++++ todo.txt | 4 ++-- version.txt | 2 +- 8 files changed, 28 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 211ccf0..5998e5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ scratch.txt +test-scratch.sh *.bak *.old old diff --git a/custom_bin/changebaud.sh b/custom_bin/changebaud.sh index e94a82c..b466716 100644 --- a/custom_bin/changebaud.sh +++ b/custom_bin/changebaud.sh @@ -3,12 +3,12 @@ subprocess() { read baudRate echo -e "\n" case $baudRate in - 1) selection=9600 ;; - 2) selection=115200 ;; - 3) selection=230400 ;; - 4) selection=460800 ;; - 5) selection=1152000 ;; - 6) selection=1500000 ;; + 1) selection=9600;; + 2) selection=115200;; + 3) selection=230400;; + 4) selection=460800;; + 5) selection=1152000;; + 6) selection=1500000;; esac return $selection @@ -17,10 +17,10 @@ subprocess() { if [ ! -z $1 ]; then ret="$1" else - ret='' - subprocess ret + ret=subprocess fi +echo "ret: $ret" export ESPBAUD=$ret echo "\nBaudrate set to $ESPBAUD\n" echo "\nAll done :3\n" \ No newline at end of file diff --git a/custom_bin/espinfo b/custom_bin/espinfo index 9d982bf..f867434 100644 --- a/custom_bin/espinfo +++ b/custom_bin/espinfo @@ -1,4 +1,5 @@ echo "esp-idf-tools install dir: $ESPIDF_INSTALLDIR" +echo "esp-idf-tools version: $(cat $ESPIDF_INSTALLDIR/esp-idf-tools/version.txt)" echo "esp-idf-tools last install: $(tail -1 $ESPIDF_INSTALLDIR/version-data.log)" echo "esp-idf path: $IDF_PATH" echo "esp-idf version: $ESP_IDF_VERSION" diff --git a/custom_bin/help-esp-tools b/custom_bin/help-esp-tools index 5bed8c8..9b039b5 100644 --- a/custom_bin/help-esp-tools +++ b/custom_bin/help-esp-tools @@ -1 +1 @@ -cat $ESPIDF_INSTALLDIR/help.txt +cat $ESPIDF_INSTALLDIR/esp-idf-tools/help.txt diff --git a/esp-idf-tools-cmd.sh b/esp-idf-tools-cmd.sh index cca1d18..73d3afc 100644 --- a/esp-idf-tools-cmd.sh +++ b/esp-idf-tools-cmd.sh @@ -123,7 +123,9 @@ function messagePTY() { for pts in $(ls -q /dev/pts); do sudo echo -e "$message" > /dev/pts/$pts # requires passwordless sudo + writeToLog "messagePTY: $message send to $pts" done + } # this is not needed so long as warn doesnt god damned fucking work lmfao @@ -459,7 +461,7 @@ function handleEnd() { endTime=$(date '+%s') timeElapsed=$(($endTime-$startTime)) - echo -e "\nesp-idf (re)installed! run \`source $rcFile\` and then \`get_idf\`\n\nAll done :3\n\n" + echo -e "\nesp-idf (re)installed! run \`source $rcFile\` and then \`get-esp-tools\`\n\nAll done :3\n\n" writeToLog "Reinstall completed in $timeElapsed seconds\n" writeToLog " === Finished ===\n\n" @@ -501,7 +503,6 @@ elif [[ "$arg" == "retool" || "$arg" == "rt" ]]; then # just reinstall bins and handleStart handleCustomBins - handleExport handleEnd exit @@ -565,7 +566,7 @@ elif [[ "$arg" == "cron" || "$arg" == "c" ]]; then # full install with warn, sle idfGet="update" sleepMins=0 - messagePTY "esp-idf-tools action $action started!\nWill reboot with $sleepMins minutes delay when complete!" + messagePTY "\n\nesp-idf-tools action $action started!\nWill reboot with $sleepMins minutes delay when complete!\n\n" handleStart handleClearInstallLog handleSetupEnvironment @@ -617,7 +618,7 @@ elif [[ "$arg" == "nukereboot" || "$arg" == "nr" ]]; then sleepMins=1 idfGet="download" - messagePTY "esp-idf-tools action $action started!\nWill reboot with $sleepMins minutes delay when complete!" + messagePTY "\n\nesp-idf-tools action $action started!\nWill reboot with $sleepMins minutes delay when complete!\n\n" handleStart handleClearInstallLog handleSetupEnvironment diff --git a/test-scratch.sh b/test-scratch.sh index b59c0b2..44150fa 100755 --- a/test-scratch.sh +++ b/test-scratch.sh @@ -1,4 +1,13 @@ #!/bin/bash + +function test_fun() { + echo "function name? $0" +} + +echo "script name? $0" +test_fun +test_fun "one" "two" 3 + if [[ ! -z $1 ]]; then message="$1" else diff --git a/todo.txt b/todo.txt index 02ec91d..79ee36a 100644 --- a/todo.txt +++ b/todo.txt @@ -1,11 +1,11 @@ test new pts messaging system integrate test espinfo -test all for bugs audit readme maybe pretty up test/fix changebaud/changebaud -test menuconfig, monitor, flashmonitor +test menuconfig, monitor, flashmonitor, exit-esp-tools +test all for bugs mayhaps support bash? # mayhaps it already works mayhaps? test diff --git a/version.txt b/version.txt index 3c789cb..07e4439 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -9-rc-3 +9-rc-2