Edited Rob Walker's commit to keep ESP_IDF consistency

pull/7751/head
Marek Fiala 2021-10-06 13:48:11 +02:00 zatwierdzone przez bot
rodzic 25619bef04
commit 8dd6d9fa5f
3 zmienionych plików z 16 dodań i 17 usunięć

Wyświetl plik

@ -12,7 +12,7 @@ if %errorlevel% neq 0 set "MISSING_REQUIREMENTS= python &echo\"
git.exe --version >NUL 2>NUL git.exe --version >NUL 2>NUL
if %errorlevel% neq 0 set "MISSING_REQUIREMENTS=%MISSING_REQUIREMENTS% git" if %errorlevel% neq 0 set "MISSING_REQUIREMENTS=%MISSING_REQUIREMENTS% git"
if not "%MISSING_REQUIREMENTS%" == "" goto :error_missing_requirements if not "%MISSING_REQUIREMENTS%" == "" goto :__error_missing_requirements
set PREFIX=python.exe %IDF_PATH% set PREFIX=python.exe %IDF_PATH%
DOSKEY idf.py=%PREFIX%\tools\idf.py $* DOSKEY idf.py=%PREFIX%\tools\idf.py $*
@ -39,7 +39,7 @@ echo Adding ESP-IDF tools to PATH...
:: but that way it is impossible to get the exit code of idf_tools.py. :: but that way it is impossible to get the exit code of idf_tools.py.
set "IDF_TOOLS_EXPORTS_FILE=%TEMP%\idf_export_vars.tmp" set "IDF_TOOLS_EXPORTS_FILE=%TEMP%\idf_export_vars.tmp"
python.exe %IDF_PATH%\tools\idf_tools.py export --format key-value >"%IDF_TOOLS_EXPORTS_FILE%" python.exe %IDF_PATH%\tools\idf_tools.py export --format key-value >"%IDF_TOOLS_EXPORTS_FILE%"
if %errorlevel% neq 0 goto :end if %errorlevel% neq 0 goto :__end
for /f "usebackq tokens=1,2 eol=# delims==" %%a in ("%IDF_TOOLS_EXPORTS_FILE%") do ( for /f "usebackq tokens=1,2 eol=# delims==" %%a in ("%IDF_TOOLS_EXPORTS_FILE%") do (
call set "%%a=%%b" call set "%%a=%%b"
@ -48,12 +48,12 @@ for /f "usebackq tokens=1,2 eol=# delims==" %%a in ("%IDF_TOOLS_EXPORTS_FILE%")
:: This removes OLD_PATH substring from PATH, leaving only the paths which have been added, :: This removes OLD_PATH substring from PATH, leaving only the paths which have been added,
:: and prints semicolon-delimited components of the path on separate lines :: and prints semicolon-delimited components of the path on separate lines
call set PATH_ADDITIONS=%%PATH:%OLD_PATH%=%% call set PATH_ADDITIONS=%%PATH:%OLD_PATH%=%%
if "%PATH_ADDITIONS%"=="" call :print_nothing_added if "%PATH_ADDITIONS%"=="" call :__print_nothing_added
if not "%PATH_ADDITIONS%"=="" echo %PATH_ADDITIONS:;=&echo. % if not "%PATH_ADDITIONS%"=="" echo %PATH_ADDITIONS:;=&echo. %
echo Checking if Python packages are up to date... echo Checking if Python packages are up to date...
python.exe %IDF_PATH%\tools\check_python_dependencies.py python.exe %IDF_PATH%\tools\check_python_dependencies.py
if %errorlevel% neq 0 goto :end if %errorlevel% neq 0 goto :__end
echo. echo.
echo Done! You can now compile ESP-IDF projects. echo Done! You can now compile ESP-IDF projects.
@ -62,16 +62,16 @@ echo.
echo idf.py build echo idf.py build
echo. echo.
goto :end goto :__end
:print_nothing_added :__print_nothing_added
echo No directories added to PATH: echo No directories added to PATH:
echo. echo.
echo %PATH% echo %PATH%
echo. echo.
goto :eof goto :eof
:error_missing_requirements :__error_missing_requirements
echo. echo.
echo Error^: The following tools are not installed in your environment. echo Error^: The following tools are not installed in your environment.
echo. echo.
@ -80,10 +80,9 @@ goto :end
echo Please use the Windows Tool installer for setting up your environment. echo Please use the Windows Tool installer for setting up your environment.
echo Download link: https://dl.espressif.com/dl/esp-idf/ echo Download link: https://dl.espressif.com/dl/esp-idf/
echo For more details please visit our website: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html echo For more details please visit our website: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html
goto :end goto :__end
:end
:__end
:: Clean up :: Clean up
if not "%IDF_TOOLS_EXPORTS_FILE%"=="" ( if not "%IDF_TOOLS_EXPORTS_FILE%"=="" (
del "%IDF_TOOLS_EXPORTS_FILE%" 1>nul 2>nul del "%IDF_TOOLS_EXPORTS_FILE%" 1>nul 2>nul

Wyświetl plik

@ -1,6 +1,6 @@
# This script should be sourced, not executed. # This script should be sourced, not executed.
function idf_export_main function __main
if not set -q IDF_PATH if not set -q IDF_PATH
echo "IDF_PATH must be set before sourcing this script" echo "IDF_PATH must be set before sourcing this script"
return 1 return 1
@ -65,7 +65,7 @@ function idf_export_main
echo "" echo ""
end end
idf_export_main __main
set click_version (python -c 'import click; print(click.__version__.split(".")[0])') set click_version (python -c 'import click; print(click.__version__.split(".")[0])')
if test $click_version -lt 8 if test $click_version -lt 8
@ -75,4 +75,4 @@ else
end end
set -e idf_export_main set -e __main

Wyświetl plik

@ -13,7 +13,7 @@ __realpath() {
__verbose() { __verbose() {
[[ -n ${IDF_QUIET} ]] && return [ -n "${IDF_EXPORT_QUIET}" ] && return
echo "$@" echo "$@"
} }
@ -145,7 +145,7 @@ __main() {
__verbose "" __verbose ""
} }
enable_autocomplete() { __enable_autocomplete() {
click_version="$(python -c 'import click; print(click.__version__.split(".")[0])')" click_version="$(python -c 'import click; print(click.__version__.split(".")[0])')"
if [[ click_version -lt 8 ]] if [[ click_version -lt 8 ]]
then then
@ -170,9 +170,9 @@ enable_autocomplete() {
} }
__main __main
enable_autocomplete __enable_autocomplete
unset __realpath unset __realpath
unset __main unset __main
unset __verbose unset __verbose
unset enable_autocomplete unset __enable_autocomplete