build: Add reset script (#10627)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
This commit is contained in:
Tomi Turtiainen
2024-09-03 15:35:13 +03:00
committed by GitHub
parent 32ce65c1af
commit c97a96d314
4 changed files with 129 additions and 177 deletions

17
scripts/ensure-zx.mjs Normal file
View File

@@ -0,0 +1,17 @@
import { accessSync, constants } from 'node:fs';
import { execSync } from 'node:child_process';
const ZX_PATH = 'node_modules/.bin/zx';
if (!zxExists()) {
execSync('pnpm --frozen-lockfile --filter n8n-monorepo install', { stdio: 'inherit' });
}
function zxExists() {
try {
accessSync(ZX_PATH, constants.F_OK);
return true;
} catch {
return false;
}
}