From 5d0814788a8f6f36de54c95fa195edd845b4a311 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Mon, 18 Aug 2025 20:19:04 -0600 Subject: [PATCH] m0ar fizax --- esp-idf-tools-cmd.sh | 19 ++++++------------- todo.txt | 8 ++++---- uninstall.sh | 13 +++++++++++-- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/esp-idf-tools-cmd.sh b/esp-idf-tools-cmd.sh index 06db230..5ee2fc0 100644 --- a/esp-idf-tools-cmd.sh +++ b/esp-idf-tools-cmd.sh @@ -301,30 +301,23 @@ function handleSetupEnvironment() { } function testAppendAlias() { - echo "Testing alias '$1'" - alias $1 2>/dev/null # redirect errrors to keep it lookan clean + echo "Testing alias '$1' in $rcFile" + grep -q "$1" "$rcFile" ret=$? if [ ! $ret -eq 0 ]; then - writeToLog "$1 not found, appending to $rcFile" + writeToLog "ailas $1 not found, appending to $rcFile" echo "$2" >> "$rcFile" returnStatus else - writeToLog "$1 found: $(alias $1), skipping\n" + writeToLog "$1 found in $rcFile, skipping\n" fi return $ret } function handleAliasEnviron() { - grep -q '# esp-idf-tools' $rcFile - ret=$? - - # add the friendly comment to the rcfile if its not there :3 - if [ ! $ret -eq 0 ]; then - writeToLog "Adding esp-idf-tools aliases to $rcFile" - echo -e "\n# esp-idf-tools\n" >> $rcFile - fi - + # the pretty comment and such first + testAppendAlias "# esp-idf-tools aliases" "\n# esp-idf-tools\n" testAppendAlias "get-esp-tools" "alias get-esp-tools='. $exportScript'" testAppendAlias "run-esp-cmd" "alias run-esp-cmd='bash $runningDir/esp-idf-tools-cmd.sh'" testAppendAlias "esp-install-monitor" "alias esp-install-monitor='tail -n 75 -f $log'" diff --git a/todo.txt b/todo.txt index 1757871..2a9cb21 100644 --- a/todo.txt +++ b/todo.txt @@ -6,10 +6,10 @@ esp-idf-cools-cmd.sh interactive/install/i seems to not work properly. variable scope? get update properly workan frong some kinda more meaningful status indication instead of endless terminal spam? -install.sh for curl -s github/install.sh | exec $SHELL installation - interactive by default or defaults mode -test da shit proper in bash finafrickingly lmfao - changeport/changeport.sh +x install.sh for curl -s github/install.sh | exec $SHELL installation + m (seems to go noninteractive by default?) interactive by default or defaults mode +x test da shit proper in bash finafrickingly lmfao + x changeport/changeport.sh x recheck espinfo x recheck changeesp/changeesp.sh x recheck changebaud/changebaud.sh diff --git a/uninstall.sh b/uninstall.sh index 53f9c82..1b4a38f 100644 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,10 +1,19 @@ #!/bin/bash echo STARTING UNINSTALLATION +# nuke dirs rm -rf ~/esp/esp-idf 2>/dev/null rm -rf ~/esp/esp-dev-kits 2>/dev/null rm -rf ~/esp/esp-idf-tools 2>/dev/null rm -rf ~/.espressif 2>/dev/null + +# nuke logs rm -f ~/esp/install.log 2>/dev/null rm -f ~/esp/version-data.log 2>/dev/null -echo DONE -# handle removing aliases from ~/.bashrc \ No newline at end of file + +# cleanup ~/.bashrc +# with first one, make a backup +sed -i.bak '/# esp-idf-tools/d' ~/.bashrc +sed -i '/get-esp-tools/d' ~/.bashrc +sed -i '/run-esp-cmd/d' ~/.bashrc +sed -i '/esp-install-monitor/d' ~/.bashrc +sed -i '/esp-install-logs/d' ~/.bashrc \ No newline at end of file