Fix CRLF breakage in Linux build scripts

The Linux build host reads these scripts from a shared mount of the
Windows working tree, where autocrlf produces CRLF line endings. bash
then failed on `set -o pipefail` (trailing CR in the option name), and
the version parsed from version.go carried a trailing CR into the Docker
tag ("...:0.6.0\r": invalid reference format).

- Add .gitattributes forcing LF on *.sh so Windows checkouts stay LF.
- Strip CR from the version extraction in all three Linux build scripts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
mixeme
2026-06-22 23:31:05 +03:00
parent 6fcaa46f7a
commit e8421fc3ff
4 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ set -euo pipefail
# Optional first argument lets a developer or CI job choose the output path. The
# default includes the application version and target platform.
version="$(sed -n 's/^var Version = "\(.*\)"/\1/p' src/app/version.go)"
version="$(sed -n 's/^var Version = "\(.*\)"/\1/p' src/app/version.go | tr -d '\r')"
version="${version:-0.0.0-dev}"
output="${1:-dist/linux/gosentry-${version}-linux-amd64}"
mkdir -p "$(dirname "$output")"