( distro: string, result: GenerateUninstallCommandResponse )
| 175 | * Generate a Linux/Unix bash uninstall script |
| 176 | */ |
| 177 | export function generateLinuxUninstallScript( |
| 178 | distro: string, |
| 179 | result: GenerateUninstallCommandResponse |
| 180 | ): { content: string; filename: string } { |
| 181 | const isNixOS = distro === 'nixos'; |
| 182 | const shebang = isNixOS ? '#!/run/current-system/sw/bin/bash' : '#!/bin/bash'; |
| 183 | |
| 184 | const content = [ |
| 185 | shebang, |
| 186 | '', |
| 187 | '# Display colorful LINITE ASCII art banner', |
| 188 | ...generateLinuxBanner('🗑️ Bulk Package Uninstaller', '\\033[1;31m'), |
| 189 | '', |
| 190 | ...(result.cleanupCommands || []), |
| 191 | '', |
| 192 | ...result.commands, |
| 193 | '', |
| 194 | ...(result.dependencyCleanupCommands || []), |
| 195 | ].join('\n'); |
| 196 | |
| 197 | return { |
| 198 | content, |
| 199 | filename: 'linite-uninstall.sh', |
| 200 | }; |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * Generate a Windows PowerShell uninstall script with colorful LINITE ASCII art |
no test coverage detected