esp-rs / esp-idf-template

A "Hello, world!" template of a Rust binary crate for the ESP-IDF framework.
Apache License 2.0
444 stars 53 forks source link

Both generated scripts (build.sh and flash.sh) won't work when running template on Windows and using Dev Containers/WSL #141

Open MihaMarkic opened 1 year ago

MihaMarkic commented 1 year ago

Bug description

Both generated scripts (build.sh and flash.sh) won't work when running template on Windows and using Dev Containers support. The problem is that .sh files on Windows are created using CR/LF, while Linux expects only LF. Saving .sh files in Windows using LF or in Linux does the trick.

To Reproduce

Run the template on Windows, use Dev Containers. Open the project in VS Code within container, try running build or build & flash.

Expected behavior

Both build and build & flash tasks should run.

Screenshots

Environment

Additional context

SergioGasquez commented 1 year ago

Thanks for reporting the issue, just did a quick test and using sed -i 's/\r$//' scripts/build.sh seems to solve the issue in WIndows.