diff --git a/Makefile b/Makefile index 7de24a3b..a16f85ce 100644 --- a/Makefile +++ b/Makefile @@ -75,7 +75,7 @@ else endif endif ############################################################# -ESPTOOL ?= ../tools/esptool.py +ESPTOOL ?= ../tools/esptool.sh CSRCS ?= $(wildcard *.c) diff --git a/tools/esptool.sh b/tools/esptool.sh new file mode 100755 index 00000000..dcbfa449 --- /dev/null +++ b/tools/esptool.sh @@ -0,0 +1,15 @@ +#!/bin/sh +ret=`python -c 'import sys; print("%i" % (sys.hexversion<0x03000000))'` +if [ $ret -eq 0 ]; then + #Retry python 2 + ret=`python2 -c 'import sys; print("%i" % (sys.hexversion<0x03000000))'` + if [ $ret -eq 0 ]; then + echo "Cannot find python2." + else + #Ok + python2 esptool.py $@ + fi +else + #Ok + python esptool.py $@ +fi \ No newline at end of file