From 565cd1069a93baf2b4b94c77d837635c06fd31a3 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Sun, 17 May 2026 23:18:41 +0200 Subject: [PATCH] fix(build): skip protected deletion check outside git worktree --- scripts/check-protected-deletions.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/check-protected-deletions.mjs b/scripts/check-protected-deletions.mjs index 339578dce..5a7fa05ce 100644 --- a/scripts/check-protected-deletions.mjs +++ b/scripts/check-protected-deletions.mjs @@ -1,8 +1,16 @@ #!/usr/bin/env node import { execFileSync } from "node:child_process"; +import { existsSync } from "node:fs"; const PROTECTED_PATHS = [":(glob)src/resources/extensions/**/*.d.ts"]; +if (!existsSync(".git")) { + process.stdout.write( + "check-protected-deletions: skipped outside git worktree\n", + ); + process.exit(0); +} + function git(args) { return execFileSync("git", args, { stdio: ["ignore", "pipe", "pipe"],