Skip to content

Commit e19e01a

Browse files
authored
firestore:delete getConfirmationMessage should include current project (#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.
1 parent 5389f50 commit e19e01a

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/commands/firestore-delete.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,41 @@ function getConfirmationMessage(deleteOp: FirestoreDelete, options: any) {
2626
return (
2727
"You are about to delete the document at " +
2828
clc.cyan(deleteOp.path) +
29-
" and all of its subcollections. Are you sure?"
29+
" and all of its subcollections " +
30+
" for " +
31+
clc.cyan(options.project) +
32+
". Are you sure?"
3033
);
3134
}
3235

3336
// Shallow document delete
34-
return "You are about to delete the document at " + clc.cyan(deleteOp.path) + ". Are you sure?";
37+
return (
38+
"You are about to delete the document at " +
39+
clc.cyan(deleteOp.path) +
40+
" for " +
41+
clc.cyan(options.project) +
42+
". Are you sure?"
43+
);
3544
}
3645

3746
// Recursive collection delete
3847
if (options.recursive) {
3948
return (
4049
"You are about to delete all documents in the collection at " +
4150
clc.cyan(deleteOp.path) +
42-
" and all of their subcollections. " +
43-
"Are you sure?"
51+
" and all of their subcollections " +
52+
" for " +
53+
clc.cyan(options.project) +
54+
". Are you sure?"
4455
);
4556
}
4657

4758
// Shallow collection delete
4859
return (
4960
"You are about to delete all documents in the collection at " +
5061
clc.cyan(deleteOp.path) +
62+
" for " +
63+
clc.cyan(options.project) +
5164
". Are you sure?"
5265
);
5366
}

0 commit comments

Comments
 (0)