Skip to content

Commit

Permalink
Require user confirmation before running morgue nuke, unless -f is pa…
Browse files Browse the repository at this point in the history
…ssed
  • Loading branch information
Jacob Shufro committed Jan 22, 2023
1 parent ce0d8d1 commit 4da20bc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/morgue.js
Original file line number Diff line number Diff line change
Expand Up @@ -5067,6 +5067,14 @@ function coronerNuke(argv, config) {
errx('No such object.');
}

if (!argv.includes("-f")) {
name = target.get('name');
const confirmation = readLine("You are about to nuke " + name + ". Please type '" + name +"' to confirm:");
if (confirmation != name) {
errx('Confirmation invalid: ' + confirmation);
}
}

bpg.delete(target, { cascade: true });

try {
Expand Down

0 comments on commit 4da20bc

Please sign in to comment.