mirror of
https://github.com/n8n-io/n8n
synced 2026-04-21 15:47:20 +00:00
chore: Add option to reset command to skip the confirmation question (#21369)
This commit is contained in:
parent
56805ca000
commit
b63a64a424
1 changed files with 9 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// Resets the repository by deleting all untracked files except for few exceptions.
|
||||
import { $, echo, fs } from 'zx';
|
||||
import { $, argv, echo, fs } from 'zx';
|
||||
|
||||
$.verbose = true;
|
||||
process.env.FORCE_COLOR = '1';
|
||||
|
|
@ -11,11 +11,15 @@ 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) ');
|
||||
const skipConfirmation = argv.force || argv.f;
|
||||
|
||||
if (!['y', 'Y', ''].includes(answer)) {
|
||||
echo('Aborting...');
|
||||
process.exit(0);
|
||||
if (!skipConfirmation) {
|
||||
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...');
|
||||
|
|
|
|||
Loading…
Reference in a new issue