thunderace / Esp8266-Arduino-Makefile

Makefile to build arduino code for ESP8266/ESP32x under linux (tested on debian X64)
34 stars 20 forks source link

./esp8266-install.sh: 13: [: unexpected operator #24

Closed flohoff closed 5 years ago

flohoff commented 5 years ago

The install of the esp8266 toolchain fails with shell error - /bin/sh is not bash but dash on modern Debian distributions - Using bash fixes the issue:

 12 cd esp8266-$ESP8266_VER/tools && ./get.py && cd ../..
 13 if [ "$OSTYPE" == "cygwin" ] || [ "$OSTYPE" == "msys" ]; then
 14         chmod +x ./esp8266-$ESP8266_VER/tools/esptool/esptool.exe

I'd suggest a change like this:

-if [ "$OSTYPE" == "cygwin" ] || [ "$OSTYPE" == "msys" ]; then
+if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" ]; then
        chmod +x ./esp8266-$ESP8266_VER/tools/esptool/esptool.exe
        chmod +x ./esp8266-$ESP8266_VER/tools/mkspiffs/mkspiffs.exe
 fi

Flo

thunderace commented 5 years ago

Thanks for the report. I work on an old debian 8 So, if the first line is changed from #!/bin/sh to #!/bin/bash it will be OK?

thunderace commented 5 years ago

Tested on debian 9.8 and cygwin with #!/bin/bash -> work