(cli *cli, edited []string, sourceRoot, destRoot string)
| 201 | } |
| 202 | |
| 203 | func handleEditedFiles(cli *cli, edited []string, sourceRoot, destRoot string) error { |
| 204 | if len(edited) < 1 { |
| 205 | return nil |
| 206 | } |
| 207 | |
| 208 | fmt.Println("Edited files/directories may be overwritten:") |
| 209 | for _, p := range edited { |
| 210 | fmt.Println(" ", p) |
| 211 | } |
| 212 | |
| 213 | fmt.Println("⚠️ DISCLAIMER: Some required base files and directories have been edited.\n" + |
| 214 | "Your added screen(s) may NOT work correctly without these updates.\n" + |
| 215 | "Proceeding without overwriting could lead to inconsistent or unstable behavior.") |
| 216 | |
| 217 | if !prompt.Confirm("Proceed with overwrite and backup? : ") { |
| 218 | cli.renderer.Warnf("User opted not to overwrite modified files.") |
| 219 | return nil |
| 220 | } |
| 221 | |
| 222 | err := backupAndOverwrite(cli, edited, sourceRoot, destRoot) |
| 223 | if err != nil { |
| 224 | cli.renderer.Warnf("Error during backup and overwrite: %v\n", err) |
| 225 | return err |
| 226 | } |
| 227 | |
| 228 | cli.renderer.Infof(ansi.Bold(ansi.Blue("Edited files backed up to back_up folder and overwritten."))) |
| 229 | |
| 230 | return nil |
| 231 | } |
| 232 | |
| 233 | // Copy missing files from source to destination. |
| 234 | func handleMissingFiles(cli *cli, missing []string, tempUnzipDir, sourcePrefix, destDir string) error { |
no test coverage detected