From 7c8d5d2782b2966ef93b5d0078a5006c4a46cecd Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Thu, 27 Sep 2018 14:55:37 +0800 Subject: [PATCH] docs, scripts: Correct the priority of the PATH setting --- add_path.sh | 2 +- docs/en/get-started-cmake/add-idf_path-to-profile.rst | 4 ++-- docs/en/get-started-cmake/linux-setup.rst | 4 ++-- docs/en/get-started-cmake/macos-setup.rst | 4 ++-- docs/en/get-started/linux-setup.rst | 4 ++-- docs/en/get-started/macos-setup.rst | 4 ++-- docs/zh_CN/get-started/linux-setup.rst | 4 ++-- docs/zh_CN/get-started/macos-setup.rst | 4 ++-- tools/windows/windows_install_prerequisites.sh | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/add_path.sh b/add_path.sh index 1d35c732aa..71257aa77a 100644 --- a/add_path.sh +++ b/add_path.sh @@ -13,7 +13,7 @@ else IDF_ADD_PATHS_EXTRAS="${IDF_ADD_PATHS_EXTRAS}:${IDF_PATH}/components/espcoredump" IDF_ADD_PATHS_EXTRAS="${IDF_ADD_PATHS_EXTRAS}:${IDF_PATH}/components/partition_table/" IDF_ADD_PATHS_EXTRAS="${IDF_ADD_PATHS_EXTRAS}:${IDF_PATH}/tools/" - export PATH="${PATH}:${IDF_ADD_PATHS_EXTRAS}" + export PATH="${IDF_ADD_PATHS_EXTRAS}:${PATH}" echo "Added to PATH: ${IDF_ADD_PATHS_EXTRAS}" fi diff --git a/docs/en/get-started-cmake/add-idf_path-to-profile.rst b/docs/en/get-started-cmake/add-idf_path-to-profile.rst index a3b3a471ef..a6268de0f7 100644 --- a/docs/en/get-started-cmake/add-idf_path-to-profile.rst +++ b/docs/en/get-started-cmake/add-idf_path-to-profile.rst @@ -41,7 +41,7 @@ Linux and MacOS Set up ``IDF_PATH`` and add ``idf.py`` to the PATH by adding the following two lines to your ``~/.profile`` file:: export IDF_PATH=~/esp/esp-idf - export PATH="$PATH:$IDF_PATH/tools" + export PATH="$IDF_PATH/tools:$PATH" .. note:: @@ -68,6 +68,6 @@ A path like ``${IDF_PATH}/tools/idf.py`` should be printed. If you do not like to have ``IDF_PATH`` or ``PATH`` modifications set, you can enter it manually in terminal window on each restart or logout:: export IDF_PATH=~/esp/esp-idf - export PATH="$PATH:$IDF_PATH/tools" + export PATH="$IDF_PATH/tools:$PATH" If you got here from section :ref:`get-started-setup-path-cmake`, while installing s/w for ESP32 development, then go back to section :ref:`get-started-start-project-cmake`. diff --git a/docs/en/get-started-cmake/linux-setup.rst b/docs/en/get-started-cmake/linux-setup.rst index 07394ca55d..cdac99ce7b 100644 --- a/docs/en/get-started-cmake/linux-setup.rst +++ b/docs/en/get-started-cmake/linux-setup.rst @@ -49,11 +49,11 @@ ESP32 toolchain for Linux is available for download from Espressif website: To use it, you will need to update your ``PATH`` environment variable in ``~/.profile`` file. To make ``xtensa-esp32-elf`` available for all terminal sessions, add the following line to your ``~/.profile`` file:: - export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin" + export PATH="$HOME/esp/xtensa-esp32-elf/bin:$PATH" Alternatively, you may create an alias for the above command. This way you can get the toolchain only when you need it. To do this, add different line to your ``~/.profile`` file:: - alias get_esp32='export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin"' + alias get_esp32='export PATH="$HOME/esp/xtensa-esp32-elf/bin:$PATH"' Then when you need the toolchain you can type ``get_esp32`` on the command line and the toolchain will be added to your ``PATH``. diff --git a/docs/en/get-started-cmake/macos-setup.rst b/docs/en/get-started-cmake/macos-setup.rst index 6a4241f4f3..7672444e8a 100644 --- a/docs/en/get-started-cmake/macos-setup.rst +++ b/docs/en/get-started-cmake/macos-setup.rst @@ -57,11 +57,11 @@ The toolchain will be extracted into ``~/esp/xtensa-esp32-elf/`` directory. To use it, you will need to update your ``PATH`` environment variable in ``~/.profile`` file. To make ``xtensa-esp32-elf`` available for all terminal sessions, add the following line to your ``~/.profile`` file:: - export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin + export PATH=$HOME/esp/xtensa-esp32-elf/bin:$PATH Alternatively, you may create an alias for the above command. This way you can get the toolchain only when you need it. To do this, add different line to your ``~/.profile`` file:: - alias get_esp32="export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin" + alias get_esp32="export PATH=$HOME/esp/xtensa-esp32-elf/bin:$PATH" Then when you need the toolchain you can type ``get_esp32`` on the command line and the toolchain will be added to your ``PATH``. diff --git a/docs/en/get-started/linux-setup.rst b/docs/en/get-started/linux-setup.rst index 00d024ac5c..9d5681b4d9 100644 --- a/docs/en/get-started/linux-setup.rst +++ b/docs/en/get-started/linux-setup.rst @@ -57,11 +57,11 @@ ESP32 toolchain for Linux is available for download from Espressif website: To use it, you will need to update your ``PATH`` environment variable in ``~/.profile`` file. To make ``xtensa-esp32-elf`` available for all terminal sessions, add the following line to your ``~/.profile`` file:: - export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin" + export PATH="$HOME/esp/xtensa-esp32-elf/bin:$PATH" Alternatively, you may create an alias for the above command. This way you can get the toolchain only when you need it. To do this, add different line to your ``~/.profile`` file:: - alias get_esp32='export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin"' + alias get_esp32='export PATH="$HOME/esp/xtensa-esp32-elf/bin:$PATH"' Then when you need the toolchain you can type ``get_esp32`` on the command line and the toolchain will be added to your ``PATH``. diff --git a/docs/en/get-started/macos-setup.rst b/docs/en/get-started/macos-setup.rst index 2708dc6e66..7e1921a6c3 100644 --- a/docs/en/get-started/macos-setup.rst +++ b/docs/en/get-started/macos-setup.rst @@ -33,11 +33,11 @@ The toolchain will be extracted into ``~/esp/xtensa-esp32-elf/`` directory. To use it, you will need to update your ``PATH`` environment variable in ``~/.profile`` file. To make ``xtensa-esp32-elf`` available for all terminal sessions, add the following line to your ``~/.profile`` file:: - export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin + export PATH=$HOME/esp/xtensa-esp32-elf/bin:$PATH Alternatively, you may create an alias for the above command. This way you can get the toolchain only when you need it. To do this, add different line to your ``~/.profile`` file:: - alias get_esp32="export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin" + alias get_esp32="export PATH=$HOME/esp/xtensa-esp32-elf/bin:$PATH" Then when you need the toolchain you can type ``get_esp32`` on the command line and the toolchain will be added to your ``PATH``. diff --git a/docs/zh_CN/get-started/linux-setup.rst b/docs/zh_CN/get-started/linux-setup.rst index d1d658924e..3457fd7a4a 100644 --- a/docs/zh_CN/get-started/linux-setup.rst +++ b/docs/zh_CN/get-started/linux-setup.rst @@ -58,11 +58,11 @@ Linux 版的 ESP32 工具链可以从 Espressif 的网站下载: 要使用工具链,你还需要在 ``~/.profile`` 文件中更新环境变量 ``PATH``。要使 ``xtensa-esp32-elf`` 在所有的终端会话中都有效,需要将下面这一行代码添加到你的 ``~/.profile`` 文件中: :: - export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin" + export PATH="$HOME/esp/xtensa-esp32-elf/bin:$PATH" 或者你也可以给上面的命令创建一个别名。这样做的好处是,你只在需要使用它的时候才获取工具链。将下面这行代码添加到 ``~/.profile`` 文件中即可: :: - alias get_esp32='export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin"' + alias get_esp32='export PATH="$HOME/esp/xtensa-esp32-elf/bin:$PATH"' 然后,当你需要使用工具链时,在命令行输入 ``get_esp32``,然后工具链会自动添加到你的 ``PATH`` 中。 diff --git a/docs/zh_CN/get-started/macos-setup.rst b/docs/zh_CN/get-started/macos-setup.rst index 781a6d7465..72596ead23 100644 --- a/docs/zh_CN/get-started/macos-setup.rst +++ b/docs/zh_CN/get-started/macos-setup.rst @@ -35,11 +35,11 @@ Mac OS 版本的 ESP32 工具链可以从以下地址下载: 在 ``~/.profile`` 文件中更新 ``PATH`` 环境变量以使用工具链。为了使 ``xtensa-esp32-elf`` 在各种终端会话中都可用,在 ``~/.profile`` 文件中加上以下指令:: - export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin + export PATH=$HOME/esp/xtensa-esp32-elf/bin:$PATH 或者,您可以为上述命令创建一个别名。这样只有执行以下指令时工具链才能被使用。将下面的指令添加到您的 ``〜/ .profile`` 文件中:: - alias get_esp32="export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin" + alias get_esp32="export PATH=$HOME/esp/xtensa-esp32-elf/bin:$PATH" 当需要使用工具链时,在命令行里输入 ``get_esp32``,就可以将工具链添加到 ``PATH`` 中。 diff --git a/tools/windows/windows_install_prerequisites.sh b/tools/windows/windows_install_prerequisites.sh index a08137197f..f13a5d714d 100644 --- a/tools/windows/windows_install_prerequisites.sh +++ b/tools/windows/windows_install_prerequisites.sh @@ -54,7 +54,7 @@ rm ~/${TOOLCHAIN_ZIP} cat > /etc/profile.d/esp32_toolchain.sh << EOF # This file was created by ESP-IDF windows_install_prerequisites.sh # and will be overwritten if that script is run again. -export PATH="\$PATH:/opt/xtensa-esp32-elf/bin" +export PATH="\/opt/xtensa-esp32-elf/bin:$PATH" EOF # clean up pacman package cache to save some disk space