diff --git a/- b/- deleted file mode 100644 index 4c78d4a..0000000 --- a/- +++ /dev/null @@ -1,8 +0,0 @@ -esp32 -esp32s2 -esp32c3 -esp32s3 -esp32c2 -esp32c6 -esp32h2 -esp32p4 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8bcc501..f42e47d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,8 @@ -9-rc-11 +9-rc-12 created CHANGELOG.txt fixed erase-flash - changeesp and add-to-export.txt now dynamically pull targets from idf.py --list-targets \ No newline at end of file + changeesp and add-to-export.txt now dynamically pull targets from idf.py --list-targets + simplified alias for idf-tools-cmd + +9-rc-final + fixed and renamed ESPIDF_INSTALLDIR ESPIDFTOOLS_INSTALLDIR \ No newline at end of file diff --git a/README.md b/README.md index bb29534..25f360b 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ Some take optional [branch] paramater * `create-project` alone prompts for a project name * `create-project ` creates a project with * ex. `create-project hello-world` -* `esp-install-monitor` monitors install.log. alias for `tail -n 75 -f $ESPIDF_INSTALLDIR/install.log` +* `esp-install-monitor` monitors install.log. alias for `tail -n 75 -f $ESPIDFTOOLS_INSTALLDIR/install.log` * `esp-install-logs` displays full text of install.log and version-data.txt * `$examples` is a shortcut for examples directory in esp-idf * ex. cd `$examples` diff --git a/add-to-export-sh.txt b/add-to-export-sh.txt index 8078af8..9b993ae 100644 --- a/add-to-export-sh.txt +++ b/add-to-export-sh.txt @@ -19,12 +19,12 @@ commitHash=commitTAG installDate=installDateTAG branchData=branchDataTAG -if [ -z $ESPIDF_INSTALLDIR ]; then - echo -e "\nFAIL: ESPIDF_INSTALLDIR environment variable not found!\nReinstall via script or manually add to ~/.zshrc\n" +if [ -z $ESPIDTOOLS_INSTALLDIR ]; then + echo -e "\nFAIL: ESPIDFTOOLS_INSTALLDIR environment variable not found!\nReinstall via script or manually add to ~/.zshrc\n" exit fi -binDir="$ESPIDF_INSTALLDIR/.custom_bin" +binDir="$ESPIDFTOOLS_INSTALLDIR/.custom_bin" echo -e "\nTTY devices found in dmesg:" COUNTER=0 @@ -43,14 +43,14 @@ echo -e "Set esp target:\n\tOne of: $(getTargets)" read esp # echo -e "\nSetting environment variables\n" -export PATH="$ESPIDF_INSTALLDIR/.custom_bin:$PATH" +export PATH="$ESPIDFTOOLS_INSTALLDIR/.custom_bin:$PATH" export ESPPORT=$ttyselect export ESPBAUD=460800 export ESPTARGET=$esp -export examples="$ESPIDF_INSTALLDIR/esp-idf/examples" +export examples="$ESPIDFTOOLS_INSTALLDIR/esp-idf/examples" echo -e "Installation Variables:" -tail -1 "$ESPIDF_INSTALLDIR/version-data.log" +tail -1 "$ESPIDFTOOLS_INSTALLDIR/version-data.log" echo -e "\tesp-idf-toolsversion: $versionData" echo -e "\tesp-idf version: $ESP_IDF_VERSION" echo -e "\tcommmit hash: $commitHash" @@ -62,7 +62,7 @@ echo -e "\nEnvironment Variables:" echo -e "\tESPBAUD = $ESPBAUD" echo -e "\tESPTARGET = $ESPTARGET" echo -e "\tESPPORT = $ESPPORT" -echo -e "\tESPIDF_INSTALLDIR = $ESPIDF_INSTALLDIR" +echo -e "\tESPIDFTOOLS_INSTALLDIR = $ESPIDFTOOLS_INSTALLDIR" echo -e "\tESP_IDF_VERSION = $ESP_IDF_VERSION" echo -e "\tbinDir = $binDir" echo -e "\texamples = $examples" @@ -73,8 +73,8 @@ alias changebaud="source $binDir/changebaud.sh" alias changeesp="source $binDir/changeesp.sh" alias exit-esp-tools="source $binDir/exit-esp-tools.sh" -# echo -e "Changing dir to $ESPIDF_INSTALLDIR" -cd $ESPIDF_INSTALLDIR +# echo -e "Changing dir to $ESPIDFTOOLS_INSTALLDIR" +# cd $ESPIDFTOOLS_INSTALLDIR echo -e "\nesp-idf version: $ESP_IDF_VERSION commit $commitHash from branch $branchData" diff --git a/custom_bin/espinfo b/custom_bin/espinfo index 360072e..e2be0a5 100644 --- a/custom_bin/espinfo +++ b/custom_bin/espinfo @@ -1,7 +1,7 @@ -echo "esp-idf-tools install dir: $ESPIDF_INSTALLDIR" -echo "esp-idf-tools custom_bin dir: $ESPIDF_INSTALLDIR/.custom_bin/" -echo "esp-idf-tools version: $(cat $ESPIDF_INSTALLDIR/.custom_bin/version.txt)" -echo "esp-idf-tools last install: $(tail -1 $ESPIDF_INSTALLDIR/version-data.log)" +echo "esp-idf-tools install dir: $ESPIDFTOOLS_INSTALLDIR" +echo "esp-idf-tools custom_bin dir: $ESPIDFTOOLS_INSTALLDIR/.custom_bin/" +echo "esp-idf-tools version: $(cat $ESPIDFTOOLS_INSTALLDIR/.custom_bin/version.txt)" +echo "esp-idf-tools last install: $(tail -1 $ESPIDFTOOLS_INSTALLDIR/version-data.log)" echo "esp-idf path: $IDF_PATH" echo "esp-idf version: $ESP_IDF_VERSION" echo "esp-idf python path: $IDF_PYTHON_ENV_PATH" diff --git a/custom_bin/exit-esp-tools.sh b/custom_bin/exit-esp-tools.sh index 04092ef..c969bce 100644 --- a/custom_bin/exit-esp-tools.sh +++ b/custom_bin/exit-esp-tools.sh @@ -1,4 +1,4 @@ -unset ESPIDF_INSTALLDIR +unset ESPIDFTOOLS_INSTALLDIR unset IDF_PATH unset ESP_IDF_VERSION unset IDF_PYTHON_ENV_PATH diff --git a/custom_bin/help-esp-tools b/custom_bin/help-esp-tools index fc17042..0d65898 100644 --- a/custom_bin/help-esp-tools +++ b/custom_bin/help-esp-tools @@ -1 +1 @@ -cat $ESPIDF_INSTALLDIR/.custom_bin/help.txt +cat $ESPIDFTOOLS_INSTALLDIR/.custom_bin/help.txt diff --git a/esp-idf b/esp-idf new file mode 160000 index 0000000..565cca2 --- /dev/null +++ b/esp-idf @@ -0,0 +1 @@ +Subproject commit 565cca2feef765c0a24146b1392eccbf4b3a6276 diff --git a/esp-idf-tools-cmd.sh b/esp-idf-tools-cmd.sh index d08237b..5ce9085 100644 --- a/esp-idf-tools-cmd.sh +++ b/esp-idf-tools-cmd.sh @@ -12,26 +12,19 @@ rcFile=$HOME/.zshrc # shell rc file gitJobs=5 # number of jobs to download from github with # gitJobs=default # default for no --jobs x arg, integar for a number of jobs rebootMins=3 # minutes of warning before reboot +defaultInstallDir="$HOME/esp" # get us our FUCKING ALIASES HOLY FUCK GOD DAMN SHIT FUCK IT\ source $rcFile 2>/dev/null # >2?/dev/null is to redirect any errors -# echo -e "\n\nSource $rcFile\n\t retval: $?\n\n" -if [ -z $ESPIDF_INSTALLDIR ]; then - installDir=$HOME/esp # path to install to. $HOME/esp by default -else - installDir=$ESPIDF_INSTALLDIR -fi - -log=$installDir/install.log # log file -versionData=$installDir/version-data.log # version data log file -idfDir=$installDir/esp-idf # esp-idf path +log="" # log file +versionData="" # version data log file +idfDir="" # esp-idf path +customBinLocation="" # where custom bin scripts are placed espressifLocation=$HOME/.espressif # espressif tools install location -customBinLocation=$installDir/.custom_bin # where custom bin scripts are placed runningDir="$( cd "$( dirname "$0" )" && pwd )" customBinFrom=$runningDir/custom_bin # dir where custom scripts are coming FROM helpText=$runningDir/help.txt -exportScript=$idfDir/export.sh # export script exportBackupScript=$runningDir/export.sh.bak # back up to running dir scriptVers=$(cat $runningDir/version.txt) # make sure version.txt does NOT have newline arg=$1 # just rename the argument var for clarity with the functions @@ -43,8 +36,6 @@ else gitCloneCmd="git clone --single-branch --depth 1 --recursive --jobs $gitJobs --branch $gitBranch https://github.com/espressif/esp-idf $idfDir" fi -# gitCloneCmd="git clone --recursive --single-branch --jobs $gitJobs --branch $gitBranch https://github.com/espressif/esp-idf $idfDir" - gitUpdateCmd="git -C $idfDir reset --hard; git -C $idfDir clean -df; git -C $idfDir pull $idfDir" # mayhapsnasst? installCmd="$idfDir/install.sh all" @@ -241,7 +232,7 @@ function handleExport() { } function handleSetupEnvironment() { - # writeToLog "Handling setup environment (function ran)\n" + # writeToLog "Handling setup environment (function ran)\n if [ ! -d "$installDir" ]; then writeToLog "creating $installDir" mkdir $installDir @@ -288,18 +279,9 @@ function handleAliasEnviron() { 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'" testAppendAlias "esp-install-logs" "alias esp-install-logs='less $versionData;less $log'" - - if [ -z $ESPIDF_INSTALLDIR ]; then - writeToLog "ESPIDF_INSTALLDIR environment variable not found, appending to $rcFile" - echo -e "export ESPIDF_INSTALLDIR=\"$installDir\"\n" >> $rcFile - returnStatus - aliasInstallDirChk=$? - else - writeToLog "ESPIDF_INSTALLDIR environment variable already installed, skipping\n" - aliasInstallDirChk=0 - fi } + function handleDownloadInstall() { # writeToLog "Handling download and install (function ran)\n" if [[ "$idfGet" == "download" || ! -d "$idfDir" ]]; then @@ -388,14 +370,25 @@ function handleCheckEspIdf() { } function handleStart() { - if [ -z $sleepMins ]; then - sleepMins="disabled" + if [ -z $ESPIDFTOOLS_INSTALLDIR ]; then + writeToLog "ESPIDFTOOLS_INSTALLDIR environment variable not found, appending to $rcFile" + echo "export ESPIDFTOOLS_INSTALLDIR=\"$defaultInstallDir\"" >> $rcFile + installDir="$defaultInstallDir" + aliasInstallDirChk=$? + else + writeToLog "ESPIDFTOOLS_INSTALLDIR environment variable already installed, skipping\n" + installDir="$ESPIDFTOOLS_INSTALLDIR" + aliasInstallDirChk=0 fi - if [ -z $ESPIDF_INSTALLDIR ]; then - installDirEnvvar="not set" - else - installDirEnvvar=$ESPIDF_INSTALLDIR + log=$installDir/install.log # log file + versionData=$installDir/version-data.log # version data log file + idfDir=$installDir/esp-idf # esp-idf path + exportScript=$idfDir/export.sh # export script + customBinLocation=$installDir/.custom_bin # where custom bin scripts are placed + + if [ -z $sleepMins ]; then + sleepMins="disabled" fi if [ "$arg" != "interactive" -a "$arg" != "i" ]; then @@ -407,7 +400,7 @@ function handleStart() { handleCheckEspIdf handleCheckInstallPackages - writeToLog "\n\tvars:\n\t\tuser: $USER\n\t\tscriptVers: $scriptVers\n\t\tversionData: $versionData\n\t\tlog: $log\n\t\tsleepMins: $sleepMins\n\t\tinstallDir: $installDir\n\t\tgitJobs: $gitJobs\n\t\tgitBranch: $gitBranch\n\t\tgitCloneCmd: $gitCloneCmd\n\t\tgitUpdateCmd: $gitUpdateCmd\n\t\t\tGitrunningDir: $runningDir\n\t\tidfDir: $idfDir\n\t\tespressifLocation: $espressifLocation\n\t\tcustomBinLocation: $customBinLocation\n\t\tcustomBinFrom: $customBinFrom\n\t\tinstallCmd: $installCmd\n\t\ttoolsInstallCmd: $toolsInstallCmd\n\t\trcFile: $rcFile\n\t\t(envvar) ESPIDF_INSTALLDIR: $installDirEnvvar\n\t\tidfGet: $idfGet\n" + writeToLog "\n\tvars:\n\t\tuser: $USER\n\t\tscriptVers: $scriptVers\n\t\tversionData: $versionData\n\t\tlog: $log\n\t\tsleepMins: $sleepMins\n\t\tinstallDir: $installDir\n\t\tgitJobs: $gitJobs\n\t\tgitBranch: $gitBranch\n\t\tgitCloneCmd: $gitCloneCmd\n\t\tgitUpdateCmd: $gitUpdateCmd\n\t\t\tGitrunningDir: $runningDir\n\t\tidfDir: $idfDir\n\t\tespressifLocation: $espressifLocation\n\t\tcustomBinLocation: $customBinLocation\n\t\tcustomBinFrom: $customBinFrom\n\t\tinstallCmd: $installCmd\n\t\ttoolsInstallCmd: $toolsInstallCmd\n\t\trcFile: $rcFile\n\t\t(envvar) ESPIDFTOOLS_INSTALLDIR: $installDir\n\t\tidfGet: $idfGet\n" } function handleEmptyLogs() { @@ -433,7 +426,7 @@ function handleUninstall() { } function handleChk() { - retCodes="Error Checking:\n\tPackages install: $pkgInstallChk\n\tGit pull/clone: $gitChk\n\tInstall script: $installChk\n\tInstall tools: $toolsInstallChk\n\tExport append: $exportCatChk\n\tExport edit return: $exportSedReturnChk\n\tExport version: $exportSedVersionChk\n\tExport date: $exportSedDateChk\n\tExport git hash: $exportSedHashChk\n\trun-esp-reinstall alias: $aliasRunEspReinstallChk\n\tesp-monitor alias: $aliasEspMonitorchk\n\tesp-logs alias: $aliasEspLogsChk\n\tESPIDF_INSTALLDIR envvar: $aliasInstallDirChk\n\tWarned Users: $warnChk\n\tLogged out users: $logoutChk\n\tAppended git log to version-data.txt: $gitLogChk\n\tAcquired git hash: $gitHashChk\n\tDeleted esp-idf dir: $rmIdfDirChk\n\tDeleted .espressif dir: $rmEspressifChk\n\tCreated install dir: $mkInstallDirChk\n\tRestored export.sh.bak: $restoreExportScriptChk\n\tDeleted old export.sh: $rmExportScriptCh\n\tBacked up export.sh to export.sh.bak: $backupExportScriptChk\n\tDeleted backup export export.bak.sh: $rmExportBackupChk\n\tMade custom scripts executable: $customBinExecChk\n\tCopied custom scripts: $cpCustomBinChk\n\tDeleted old custom scripts dir: $rmCustomBinChk\n\tWoke from sleep: $sleepChk" + retCodes="Error Checking:\n\tPackages install: $pkgInstallChk\n\tGit pull/clone: $gitChk\n\tInstall script: $installChk\n\tInstall tools: $toolsInstallChk\n\tExport append: $exportCatChk\n\tExport edit return: $exportSedReturnChk\n\tExport version: $exportSedVersionChk\n\tExport date: $exportSedDateChk\n\tExport git hash: $exportSedHashChk\n\trun-esp-reinstall alias: $aliasRunEspReinstallChk\n\tesp-monitor alias: $aliasEspMonitorchk\n\tesp-logs alias: $aliasEspLogsChk\n\tESPIDFTOOLS_INSTALLDIR envvar: $installDir\n\tWarned Users: $warnChk\n\tLogged out users: $logoutChk\n\tAppended git log to version-data.txt: $gitLogChk\n\tAcquired git hash: $gitHashChk\n\tDeleted esp-idf dir: $rmIdfDirChk\n\tDeleted .espressif dir: $rmEspressifChk\n\tCreated install dir: $mkInstallDirChk\n\tRestored export.sh.bak: $restoreExportScriptChk\n\tDeleted old export.sh: $rmExportScriptCh\n\tBacked up export.sh to export.sh.bak: $backupExportScriptChk\n\tDeleted backup export export.bak.sh: $rmExportBackupChk\n\tMade custom scripts executable: $customBinExecChk\n\tCopied custom scripts: $cpCustomBinChk\n\tDeleted old custom scripts dir: $rmCustomBinChk\n\tWoke from sleep: $sleepChk" totalErrorLoad=$(($pkgInstallChk+$gitChk+$gitChk+$installChk+$toolsInstallChk+$exportSedHashChk+$exportCatChk+$exportSedReturnChk+$aliasRunEspReinstallChk+$aliasEspMonitorchk+$aliasEspLogsChk+$aliasInstallDirChk+$warnChk+$logoutChk+$gitLogChk+$gitHashChk+$rmIdfDirChk+$rmEspressifChk+$mkInstallDirChk+$restoreExportScriptChk+$rmExportScriptChk+$backupExportScriptChk+$customBinExecChk+$rmCustomBinChk+$sleepChk+$rmExportBackupChk)) diff --git a/help.txt b/help.txt index 8c76eb9..34e446d 100644 --- a/help.txt +++ b/help.txt @@ -103,7 +103,7 @@ Features: `create-project` alone prompts for a project name `create-project ` creates a project with ex. `create-project hello-world` - `esp-install-monitor` monitors install.log. alias for `tail -n 75 -f $ESPIDF_INSTALLDIR/install.log` + `esp-install-monitor` monitors install.log. alias for `tail -n 75 -f $ESPIDFTOOLS_INSTALLDIR/install.log` `esp-install-logs` displays full text of install.log and version-data.txt `$examples` is a shortcut for examples directory in esp-idf ex. cd $examples` diff --git a/sed b/sed deleted file mode 100644 index 4c78d4a..0000000 --- a/sed +++ /dev/null @@ -1,8 +0,0 @@ -esp32 -esp32s2 -esp32c3 -esp32s3 -esp32c2 -esp32c6 -esp32h2 -esp32p4 diff --git a/todo.txt b/todo.txt index f42ecda..b108bee 100644 --- a/todo.txt +++ b/todo.txt @@ -2,9 +2,14 @@ text export and changeesp test help on cmd, help-esp-tools test sourced scrips changebaud, changeesp, changeport test menuconfig, monitor, flashmonitor, exit-esp-tools +test / fix / remove esp-idf-tools-cmd.sh options +remove unneeded code audit readme maybe pretty up test all for bugs + +add error handling to changeesp, changeport, and export on esp and port functions + figure out esp32 disable sanity check create blank project as master add Kconfig.projbuild sample diff --git a/version.txt b/version.txt index c67470b..d9a5a4a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -9-rc-11 \ No newline at end of file +9-rc-final \ No newline at end of file