mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -08:00
c97a96d314
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Waiting to run
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
31 lines
922 B
JavaScript
31 lines
922 B
JavaScript
// Resets the repository by deleting all untracked files except for few exceptions.
|
|
import { $, echo, fs } from 'zx';
|
|
|
|
$.verbose = true;
|
|
process.env.FORCE_COLOR = '1';
|
|
|
|
const excludePatterns = ['/.vscode/', '/.idea/', '.env'];
|
|
const excludeFlags = excludePatterns.map((exclude) => ['-e', exclude]).flat();
|
|
|
|
echo(
|
|
`This will delete all untracked files except for those matching the following patterns: ${excludePatterns.map((x) => `"${x}"`).join(', ')}.`,
|
|
);
|
|
|
|
const answer = await question('❓ Do you want to continue? (y/n) ');
|
|
|
|
if (!['y', 'Y', ''].includes(answer)) {
|
|
echo('Aborting...');
|
|
process.exit(0);
|
|
}
|
|
|
|
echo('🧹 Cleaning untracked files...');
|
|
await $({ verbose: false })`git clean -fxd ${excludeFlags}`;
|
|
// In case node_modules is not removed by git clean
|
|
fs.removeSync('node_modules');
|
|
|
|
echo('⏬ Running pnpm install...');
|
|
await $`pnpm install`;
|
|
|
|
echo('🏗️ Running pnpm build...');
|
|
await $`pnpm build`;
|