Skip to content

Commit 4da20bc

Browse files
author
Jacob Shufro
committed
Require user confirmation before running morgue nuke, unless -f is passed
1 parent ce0d8d1 commit 4da20bc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bin/morgue.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5067,6 +5067,14 @@ function coronerNuke(argv, config) {
50675067
errx('No such object.');
50685068
}
50695069

5070+
if (!argv.includes("-f")) {
5071+
name = target.get('name');
5072+
const confirmation = readLine("You are about to nuke " + name + ". Please type '" + name +"' to confirm:");
5073+
if (confirmation != name) {
5074+
errx('Confirmation invalid: ' + confirmation);
5075+
}
5076+
}
5077+
50705078
bpg.delete(target, { cascade: true });
50715079

50725080
try {

0 commit comments

Comments
 (0)