Skip to content

Commit 835f469

Browse files
committed
LPD-68594 only prompt for confirmation if a real project will be deleted
1 parent a96c339 commit 835f469

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

scripts/cli/lec.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,7 @@ cmd_init() {
692692
existing_worktree="$(_getWorktreeDir "${worktree_name}")"
693693

694694
if [[ "${existing_worktree}" ]]; then
695-
_print_step "Worktree ${worktree_name} already exists at: ${existing_worktree}. You may remove it if you want to create a worktree with the same name."
696-
697-
if ! _confirm "Are you sure you want to remove the project ${C_YELLOW}${worktree_name}${C_NC}? The project directory and all data will be removed."; then
695+
if [[ -d "${existing_worktree}" ]] && ! _confirm "Do you want to replace the existing project ${C_YELLOW}${worktree_name}${C_NC}? Any existing data will be removed."; then
698696
exit 1
699697
fi
700698

0 commit comments

Comments
 (0)