diff --git a/scripts/cli/lec.sh b/scripts/cli/lec.sh index 60c43c6..f8a29cd 100755 --- a/scripts/cli/lec.sh +++ b/scripts/cli/lec.sh @@ -373,10 +373,6 @@ _removeWorktree() { local worktree_name="${worktree##*/}" - 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 - return - fi - _print_step "Shutting down project and removing Docker volumes..." ( cd "${worktree}" || exit 1 @@ -538,7 +534,12 @@ _cmd_remove2() { worktrees="$(_listWorktrees | grep -E -v "^${LIFERAY_ENVIRONMENT_COMPOSER_HOME}$" | _selectMultiple "Choose projects to remove (Tab to select multiple)")" _cancelIfEmpty "${worktrees}" + printf "${C_BOLD}Projects to be removed:\n\n${C_YELLOW}%s${C_RESET}\n\n" "${worktrees}" + + _confirm "Are you sure you want to remove them? This cannot be undone." + for worktree in ${worktrees}; do + _print_step "Removing project ${C_YELLOW}${worktree}${C_NC}" _removeWorktree "${worktree}" echo done @@ -674,6 +675,10 @@ cmd_remove() { worktree="$(_listWorktrees | _select "Choose a project to remove")" _cancelIfEmpty "${worktree}" + 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 + return + fi + _removeWorktree "${worktree}" } cmd_share() {