Add a sh script for esptool.py py2 detection
This commit is contained in:
parent
1f83c82a2d
commit
c470eade35
2
Makefile
2
Makefile
|
@ -75,7 +75,7 @@ else
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
#############################################################
|
#############################################################
|
||||||
ESPTOOL ?= ../tools/esptool.py
|
ESPTOOL ?= ../tools/esptool.sh
|
||||||
|
|
||||||
|
|
||||||
CSRCS ?= $(wildcard *.c)
|
CSRCS ?= $(wildcard *.c)
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue