diff --git a/.gitignore b/.gitignore index f0c6490..97cf2f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ -notes.txt scratch.txt *.bak -next-* +*.old old .vscode \ No newline at end of file diff --git a/README.md b/README.md index 6685f45..2691853 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ pulls from master so its the very latest built for debian-like systems only currently tested on zsh -some features require user to have passwordless sudo rights +some features require user to have passwordless sudo rights + +Literally the most schizophrenically overengineered thing I have ever made. idk why I did that ## Quick start `git clone https://github.com/PrincessPi3/esp-install-custom.git ~` diff --git a/reinstall-esp-idf.sh b/reinstall-esp-idf.sh old mode 100644 new mode 100755 index 25edd22..2bbc00d --- a/reinstall-esp-idf.sh +++ b/reinstall-esp-idf.sh @@ -1,5 +1,5 @@ #!/bin/bash -# set -e # for testan, die on eelrror +# set -e # uncomment for die on error startTime=$(date '+%s') # to time the (re)install time for the logs gitBranch=master # branch from github @@ -19,7 +19,7 @@ else fi log=$installDir/install.log # log file -versionData=$installDir/version-data.txt # version data log file +versionData=$installDir/version-data.log # version data log file idfDir=$installDir/esp-idf # esp-idf path espressifLocation=$HOME/.espressif # espressif tools install location customBinLocation=$installDir/.custom_bin # where custom bin scripts are placed @@ -83,6 +83,7 @@ rmExportBackupChk=0 # set sleepMins int variable # redefine any other vars needed # handleStart +# handleClearInstallLog # handleLogoutAllUsers # handleSetupEnvironment # handleCustomBins @@ -461,6 +462,15 @@ function handleChk() { fi } +function handleClearInstallLog() { + if [ -f "$log" ]; then + echo -e "\nClearing install.log\n" + rm "$log" + else + echo "\n$log Not Found, Skipping Delete\n" + fi +} + function handleEnd() { handleChk @@ -575,6 +585,7 @@ elif [[ "$arg" == "cron" || "$arg" == "c" ]]; then # full install with warn, sle sleepMins=0 handleStart + handleClearInstallLog handleLogoutAllUsers handleSetupEnvironment handleCustomBins @@ -595,7 +606,10 @@ elif [[ "$arg" == "nuke" || "$arg" == "n" ]]; then # clear logs action="REINSTALL (NUKE)" idfGet="download" + + handleStart + handleClearInstallLog handleSetupEnvironment handleCustomBins handleDownloadInstall @@ -617,6 +631,7 @@ else # full noninteractive (re)install without logout, reboot, or sleeps action="REINSTALL (DEFAULT)" handleStart + handleClearInstallLog handleSetupEnvironment handleCustomBins handleDownloadInstall diff --git a/test-scratch.sh b/test-scratch.sh old mode 100644 new mode 100755 diff --git a/todo.txt b/todo.txt index 9622567..5bb28b2 100644 --- a/todo.txt +++ b/todo.txt @@ -1,55 +1,22 @@ -x maybe add retool to combined script? -x add esp install paths and such to envvars in ~/.zshrc -x functionize retool some -x custom_bin -x export -x prolly refactor some lmfao -x test --single-branch vs non -x redo comments -x handleLogoutAllUsers log users test -x handleWarnAllUsers log users test -x interactive mode -x check end time loggan -x clean up writeToLog to avoid repeated date() -x export updoots -x install applications, use which? -x test missing packages -x update repos instead of re-downoadan? -x test --single-branch -x time download and install -x use return codes to define if install likely completed successfully -x upon success, touch some file to show success -x when script starts, delete the touched files -x touch up add-to-export-sh.txt -x alias add and document too - x maybe just cat a txt lmao -x test reinstall from zero -x fix dat nuke issue on line ~307 # fixed? -x standardize the capatilization and format and content of notes -x bug: duplicate export added to export.sh -x involves testExport prolly lol -x issue be in retool -x remove the log writes at entry functions - -testan: - x bash reinstall-esp-idf.sh help - x bash reinstall-esp-idf.sh --help - x bash reinstall-esp-idf.sh -h - x bash reinstall-esp-idf.sh h - x bash reinstall-esp-idf.sh test - x bash reinstall-esp-idf.sh t - x bash reinstall-esp-idf.sh retool - x bash reinstall-esp-idf.sh rt - x bash reinstall-esp-idf.sh - x bash reinstall-esp-idf.sh clearlogs - x bash reinstall-esp-idf.sh clear - x bash reinstall-esp-idf.sh clean - x bash reinstall-esp-idf.sh cl - x bash reinstall-esp-idf.sh interactive - x bash reinstall-esp-idf.sh i - x bash reinstall-esp-idf.sh nuke - x bash reinstall-esp-idf.sh n - x bash reinstall-esp-idf.sh uninstall +test: + bash reinstall-esp-idf.sh help + bash reinstall-esp-idf.sh --help + bash reinstall-esp-idf.sh -h + bash reinstall-esp-idf.sh h + bash reinstall-esp-idf.sh test + bash reinstall-esp-idf.sh t + bash reinstall-esp-idf.sh retool + bash reinstall-esp-idf.sh rt + bash reinstall-esp-idf.sh + bash reinstall-esp-idf.sh clearlogs + bash reinstall-esp-idf.sh clear + bash reinstall-esp-idf.sh clean + bash reinstall-esp-idf.sh cl + bash reinstall-esp-idf.sh interactive + bash reinstall-esp-idf.sh i + bash reinstall-esp-idf.sh nuke + bash reinstall-esp-idf.sh n + bash reinstall-esp-idf.sh uninstall bash reinstall-esp-idf.sh cron bash reinstall-esp-idf.sh c