argument('identifier'); try { // 템플릿 디렉토리 스캔 및 로드 $this->templateManager->loadTemplates(); // 템플릿 존재 확인 $template = $this->templateRepository->findByIdentifier($identifier); if (! $template) { $this->error('❌ '.__('templates.commands.activate.not_installed', ['template' => $identifier])); return Command::FAILURE; } // 삭제 확인 프롬프트 $this->warn(__('templates.commands.uninstall.confirm_prompt', ['template' => $identifier])); $this->warn(__('templates.commands.uninstall.confirm_details.layouts', ['count' => $template->layouts()->count()])); $this->warn(__('templates.commands.uninstall.confirm_details.versions')); if (! $this->unifiedConfirm(__('templates.commands.uninstall.confirm_question'), false)) { $this->info(__('templates.commands.uninstall.aborted')); return Command::SUCCESS; } // 레이아웃 및 버전 개수 조회 $layoutsCount = $template->layouts()->count(); // 템플릿 삭제 $onProgress = $this->createProgressCallback(TemplateManager::UNINSTALL_STEPS); try { $result = $this->templateManager->uninstallTemplate($identifier, $onProgress, $preservedBackups); $this->finishProgress(); } catch (\Exception $e) { $this->finishProgress(); throw $e; } if ($result) { // 성공 메시지 $this->info('✅ '.__('templates.commands.uninstall.success', ['template' => $identifier])); $this->info(' - '.__('templates.commands.uninstall.layouts_deleted', ['count' => $layoutsCount])); // 운영자가 넣은 `custom/` 은 삭제 전에 사본을 남긴다 — 그 경로를 알리지 않으면 // 로그를 뒤지지 않는 한 사본의 존재를 알 수 없다. foreach ($preservedBackups ?? [] as $backup) { $this->info(' - '.__('templates.commands.uninstall.custom_preserved', [ 'directory' => $backup['directory'], 'archive' => $backup['archive'], ])); } Log::info(__('templates.commands.uninstall.success', ['template' => $identifier])); return Command::SUCCESS; } return Command::FAILURE; } catch (\Exception $e) { $this->error('❌ '.$e->getMessage()); Log::error('템플릿 삭제 실패', [ 'template' => $identifier, 'error' => $e->getMessage(), ]); return Command::FAILURE; } } }