Enforce LF line endings for Unix artifacts via .gitattributes
Template tests / tests (pull_request) Failing after 32s
Template tests / tests (pull_request) Failing after 32s
A shell script, .desktop, .rules, or .spec file checked out with CRLF (Windows with core.autocrlf=true) breaks when run/parsed on Linux — a `#!/usr/bin/env bash\r` shebang is a "bad interpreter" error, and the Linux package would ship broken scripts. Pin these (and other text) to LF, and mark binary assets (png/gz/traineddata) so they are never converted. Also harden the packaging/wayland structural tests to strip CR defensively. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
@@ -6,7 +6,8 @@ const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const ROOT = path.resolve(__dirname, '..', '..');
|
||||
const read = (rel) => fs.readFileSync(path.join(ROOT, rel), 'utf8');
|
||||
// Strip CR so /^...$/m assertions are robust to CRLF checkouts on Windows CI.
|
||||
const read = (rel) => fs.readFileSync(path.join(ROOT, rel), 'utf8').replace(/\r\n/g, '\n');
|
||||
const exists = (rel) => fs.existsSync(path.join(ROOT, rel));
|
||||
|
||||
// These are structural checks that run in the normal (cross-platform) unit
|
||||
|
||||
@@ -9,7 +9,8 @@ const { chooseCaptureTrigger, detectLinuxCapabilities } = require('../../app/pla
|
||||
const platform = require('../../app/platform');
|
||||
|
||||
const ROOT = path.resolve(__dirname, '..', '..');
|
||||
const read = (rel) => fs.readFileSync(path.join(ROOT, rel), 'utf8');
|
||||
// Strip CR so assertions are robust to CRLF checkouts on Windows CI.
|
||||
const read = (rel) => fs.readFileSync(path.join(ROOT, rel), 'utf8').replace(/\r\n/g, '\n');
|
||||
const exists = (rel) => fs.existsSync(path.join(ROOT, rel));
|
||||
|
||||
// ---- honest trigger decisions ----------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user