Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/Tools/scripts/esp32_get_idf.sh
Views: 1798
#!/usr/bin/env bash1# if you have modules/esp_idf setup as a submodule, then leave it as a submodule and switch branches23COMMIT="cc3203dc4f087ab41b434afff1ed7520c6d90993"45if [ ! -d modules ]; then6echo "this script needs to be run from the root of your repo, sorry, giving up."7exit 18fi9echo `ls modules`10cd modules1112if [ ! -d esp_idf ]; then13echo 'did not find modules/esp_idf folder, making it.' ;14mkdir -p -v esp_idf15else16echo 'found modules/esp_idf folder' ;17fi1819echo "looking for submodule or repo..."20if [ `git submodule | grep esp_idf | wc | cut -c1-7` == '1' ]; then21echo "found real submodule, syncing"22../Tools/gittools/submodule-sync.sh >/dev/null23else24echo "esp_idf is NOT a submodule"2526if [ ! `ls esp_idf/install.sh 2>/dev/null` ]; then27echo "found empty IDF, cloning"28# add esp_idf as almost submodule, depths uses less space29git clone -b 'release/v5.3' https://github.com/espressif/esp-idf.git esp_idf30git checkout $COMMIT31fi32fi3334echo "inspecting possible IDF... "35cd esp_idf36echo `git rev-parse HEAD`37# these are a selection of possible specific commit/s that represent v5.3 branch of the esp_idf38if [ `git rev-parse HEAD` == '$COMMIT' ]; then39echo "IDF version 'release/5.3' found OK, great.";40else41echo "looks like an idf, but not v5.3 branch, or wrong commit , trying to switch branch and reflect upstream";42../../Tools/gittools/submodule-sync.sh >/dev/null43git fetch ; git checkout -f release/v5.344git checkout $COMMIT4546# retry same as above47echo `git rev-parse HEAD`48if [ `git rev-parse HEAD` == '$COMMIT' ]; then49echo "IDF version 'release/5.3' found OK, great.";50git checkout $COMMIT51fi52fi53cd ../..5455cd modules/esp_idf56git submodule update --init --recursive5758echo59echo "installing missing python modules"60python -m pip install empy==3.3.461python -m pip install pexpect62python -m pip install future6364cd ../..6566echo67echo "after changing IDF versions [ such as between 4.4 and 5.3 ] you should re-run these in your console:"68echo "./modules/esp_idf/install.sh"69echo "source ./modules/esp_idf/export.sh"707172