diff --git a/11_write_factorytest_by_esptool.sh b/11_write_factorytest_by_esptool.sh index f4ec148..c308eb5 100755 --- a/11_write_factorytest_by_esptool.sh +++ b/11_write_factorytest_by_esptool.sh @@ -4,6 +4,8 @@ # Get esptool command BUILD_TOOL=$(lib_get_esptool_command) +echo "===" +echo $BUILD_TOOL # Find port - Cross-platform detection PORT=$(lib_detect_esptool_port) diff --git a/lib.sh b/lib.sh index bdb8897..9b2d682 100644 --- a/lib.sh +++ b/lib.sh @@ -8,21 +8,24 @@ echo "esptool.py" else if ! command -v $WIN_PYTHON &> /dev/null - then - echo "esptool.py nor $WIN_PYTHON could not be found. Please install it first." - exit 1 - fi + then + echo "esptool.py nor $WIN_PYTHON could not be found. Please install it first." + exit 1 + else # check if esptool is installed as a module if py.exe -m esptool --help &> /dev/null then echo "$WIN_PYTHON -m esptool" return else - echo "install esptool module for python first." - $WIN_PYTHON -m pip install esptool + echo "installing esptool module for python first." + bash -c "$WIN_PYTHON -m pip install esptool" + echo "Please execute the script again." + return fi echo "$WIN_PYTHON -m esptool" fi + fi } lib_detect_esptool_port() {