n8n/scripts/prepare.mjs
Charlie Kolb f71a94ddf9
chore: Add opt-in dev-tooling usage metrics (no-changelog) (#33620)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Matsuuu <matias.huhta@n8n.io>
2026-07-15 10:54:41 +00:00

23 lines
658 B
JavaScript

#!/usr/bin/env node
import { execFileSync, execSync } from 'node:child_process';
import { resolve } from 'node:path';
// Skip lefthook install in CI or Docker build
if (process.env.CI || process.env.DOCKER_BUILD) {
process.exit(0);
}
execSync('pnpm lefthook install', { stdio: 'inherit' });
// Opt-in anonymous dev-tooling metrics (internal developers only). Best-effort:
// must never break `pnpm install`.
try {
// execFileSync (no shell) so a checkout path with spaces still works.
execFileSync('node', [resolve(import.meta.dirname, 'dev-metrics', 'setup.mjs')], {
stdio: 'inherit',
});
} catch {
// ignore — metrics setup is non-essential
}