Files
cacti/build/clean-node-modules.mjs
TheWitness 7b551eea72 chore: normalize CRLF line endings to LF across Cacti-owned files (#8156)
Excludes vendored packages, third-party JS, patches, and the Win32 probe fixture. Pure EOL change; guards pass and php -l is clean.
2026-10-02 17:22:42 -04:00

10 lines
420 B
JavaScript

// A production Cacti checkout should not ship a node_modules folder, but CI
// jobs run tests against it after `npm ci` triggers this script via
// postinstall, so removal is skipped whenever the standard CI=true env var
// (set by GitHub Actions and effectively every other CI provider) is present.
import { rmSync } from 'node:fs';
if (!process.env.CI) {
rmSync('node_modules', { recursive: true, force: true });
}