From f08a2271fe09556c0256069279ab9da2fa266900 Mon Sep 17 00:00:00 2001 From: Alex Johansson Date: Sat, 16 Oct 2021 17:35:53 +0200 Subject: [PATCH] fix: `check-changed-files`-job always failing on `main` (#969) --- scripts/ts-check-changed-files.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/ts-check-changed-files.ts b/scripts/ts-check-changed-files.ts index 6612bb503d..bcd48955fd 100644 --- a/scripts/ts-check-changed-files.ts +++ b/scripts/ts-check-changed-files.ts @@ -3,15 +3,14 @@ import { execSync } from "child_process"; const diff = execSync(`git diff --name-only origin/main HEAD`).toString(); -const files = diff.trim().split("\n"); +const files = diff + .trim() + .split("\n") + .map((file) => file.trim()) + .filter(Boolean); console.log("ℹ️ Changed files:"); -console.log( - files - .filter(Boolean) - .map((str) => ` - ${str}`) - .join("\n") -); +console.log(files.map((str) => ` - ${str}`).join("\n")); try { console.log("⏳ Checking type errors..");