From 0cfd8b133ae9b721a33bbff35e8039f5698763fe Mon Sep 17 00:00:00 2001 From: matevip Date: Tue, 21 Jul 2026 10:28:26 +0800 Subject: [PATCH] fix(build): pin shell/SQL scripts to LF via .gitattributes --- .gitattributes | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..53cdcbed --- /dev/null +++ b/.gitattributes @@ -0,0 +1,19 @@ +# Line-ending policy. +# +# Shell scripts are bind-mounted into Linux containers (e.g. +# docker/postgres/init/ -> /docker-entrypoint-initdb.d) and executed there. +# A CRLF checkout on Windows (core.autocrlf=true is the Git for Windows +# default) turns the shebang into "#!/bin/sh\r", which fails with +# "cannot execute: required file not found". Pin them to LF everywhere. +# +# SQL files are pinned to LF too so Flyway migration checksums stay +# identical across platforms. + +*.sh text eol=lf +*.bash text eol=lf +*.sql text eol=lf + +# Windows-native scripts keep CRLF. +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf