Jelajahi Sumber

fix(host): normalize release scripts to LF

root 3 bulan lalu
induk
melakukan
cf5fa387f2
1 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 6 1
      tools/build_amd64_release.py

+ 6 - 1
tools/build_amd64_release.py

@@ -37,7 +37,12 @@ def copy_file(source: Path, target: Path, mode: int = 0o644) -> None:
     if not source.is_file():
         raise FileNotFoundError(source)
     target.parent.mkdir(parents=True, exist_ok=True)
-    shutil.copyfile(source, target)
+    if source.suffix == ".sh":
+        # A Windows checkout may contain CRLF. Release scripts must keep a
+        # Linux shebang and LF line endings after extraction.
+        target.write_bytes(source.read_bytes().replace(b"\r\n", b"\n"))
+    else:
+        shutil.copyfile(source, target)
     target.chmod(mode)