green-code-initiative / ecoCode-android

Reduce the environmental footprint of your Java-based Android apps with SonarQube
https://ecocode.io
GNU General Public License v3.0
57 stars 17 forks source link

build: Make codenarc SH script work under Windows (Docker compose) #37

Closed cyChop closed 1 year ago

cyChop commented 1 year ago

Depending on the user's config (esp. core.autocrlf), line endings may be changed in source files. In most cases, this isn't an issue, but in Shell script file, the carriage return character (CR) can cause issues in interpretation. This can be detected when trying to launch the docker-compose script and having the "‘sh\r’: No such file or directory" error message: the "\r" is the carriage return being interpreted as part of the command.

This commit fixes this by specifying that .sh files should always be checked out with LF endings, not CRLF. .bat files are additionally set with CRLF endings.

Additionally:

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information