Skip to content

Commit b1649ea

Browse files
committed
feat(backup): add confirmation before creating a backup
1 parent fb4732f commit b1649ea

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/core/taskmaster/exec.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,20 @@ export async function tmaiBackupRestoreClearAsync() {
388388
switch (tmaiBackupRestoreClearMenu) {
389389
case "tmai-backup": {
390390
const slot = await askBackupSlotAsync();
391-
await tmai.backupAsync(slot);
391+
const { confirm } = await inquirer.prompt({
392+
type: "confirm",
393+
name: "confirm",
394+
message: chalk.yellow(
395+
`Are you sure you want to create a backup in slot ${slot}?`,
396+
),
397+
default: false,
398+
});
399+
400+
if (confirm) {
401+
await tmai.backupAsync(slot);
402+
} else {
403+
console.log("Backup operation cancelled!");
404+
}
392405
break;
393406
}
394407
case "tmai-restore": {

0 commit comments

Comments
 (0)