Skip to content

Commit

Permalink
firestore:delete getConfirmationMessage should include current project (
Browse files Browse the repository at this point in the history
#3457)

The firestore:delete command should notify the user of the current project. This should help users minimize chances of accidental deletions when switching between projects.
  • Loading branch information
davidbrenner authored Jun 8, 2021
1 parent 5389f50 commit e19e01a
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/commands/firestore-delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,41 @@ function getConfirmationMessage(deleteOp: FirestoreDelete, options: any) {
return (
"You are about to delete the document at " +
clc.cyan(deleteOp.path) +
" and all of its subcollections. Are you sure?"
" and all of its subcollections " +
" for " +
clc.cyan(options.project) +
". Are you sure?"
);
}

// Shallow document delete
return "You are about to delete the document at " + clc.cyan(deleteOp.path) + ". Are you sure?";
return (
"You are about to delete the document at " +
clc.cyan(deleteOp.path) +
" for " +
clc.cyan(options.project) +
". Are you sure?"
);
}

// Recursive collection delete
if (options.recursive) {
return (
"You are about to delete all documents in the collection at " +
clc.cyan(deleteOp.path) +
" and all of their subcollections. " +
"Are you sure?"
" and all of their subcollections " +
" for " +
clc.cyan(options.project) +
". Are you sure?"
);
}

// Shallow collection delete
return (
"You are about to delete all documents in the collection at " +
clc.cyan(deleteOp.path) +
" for " +
clc.cyan(options.project) +
". Are you sure?"
);
}
Expand Down

0 comments on commit e19e01a

Please sign in to comment.