From fcd2b04397b47c6f11e4e0989fa98819b2d6edfc Mon Sep 17 00:00:00 2001 From: mateaix <57164338+mateaix@users.noreply.github.com> Date: Mon, 20 Jul 2026 21:58:41 +0800 Subject: [PATCH] fix(build): pin shell/SQL scripts to LF via .gitattributes (#544) Windows checkouts with core.autocrlf=true (the Git for Windows default) converted docker/postgres/init/10-app-role.sh to CRLF, so the container entrypoint failed with 'cannot execute: required file not found' and the postgres/server containers crash-looped. Pinning *.sh/*.sql to LF makes Windows clones produce container-executable scripts regardless of the local autocrlf setting. Co-Authored-By: Claude Fable 5 --- .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