giraffe-fsharp / giraffe-template

A dotnet new template for Giraffe web applications.
Apache License 2.0
37 stars 22 forks source link

build.sh in template should have LF line endings, not CRLF #17

Closed rmunn closed 5 years ago

rmunn commented 6 years ago

Currently the build.sh file generated by running dotnet new giraffe is created with CRLF line endings. When run on Linux (where LF line endings are the norm), this results in the CR character being seen as part of the line, like so (^M represents a CR in this listing):

dotnet restore src/LearnGiraffe^M
dotnet build src/LearnGiraffe^M

This results in the dotnet CLI tool saying "Project file does not exist", because it's looking for a directory named src/LearnGiraffe^M, which of course does not exist. If the build.sh file is produced with LF line endings instead of CRLF, then it should work properly.

I tested on Linux Mint 18, equivalent to Ubuntu 16.04, but I expect the same thing would happen on just about any Linux version.

rmunn commented 6 years ago

The simplest solution is probably to add a line to .gitattributes saying:

*.sh text eol=lf

Then when Appveyor checks out the build.sh file to build the NuGet package for this template, it will check it out with LF line endings, and the NuGet package will then contain a build.sh file with the right line endings.

dustinmoris commented 5 years ago

This will be fixed in the 0.18.0 release of the giraffe-templte NuGet package which is currently being build on the build server!