import { existsSync, rmSync } from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const rootDir = path.resolve(__dirname, ".."); const artifactsDir = path.join(rootDir, "dist-firefox", "web-ext-artifacts"); if (existsSync(artifactsDir)) { rmSync(artifactsDir, { recursive: true, force: true }); console.log(`Removed stale Firefox package artifacts from ${path.relative(rootDir, artifactsDir)}`); }