(appId string, fileName string)
| 318 | } |
| 319 | |
| 320 | func DeleteAppFile(appId string, fileName string) error { |
| 321 | if err := ValidateAppId(appId); err != nil { |
| 322 | return fmt.Errorf("invalid appId: %w", err) |
| 323 | } |
| 324 | |
| 325 | appDir, err := GetAppDir(appId) |
| 326 | if err != nil { |
| 327 | return err |
| 328 | } |
| 329 | |
| 330 | filePath, err := validateAndResolveFilePath(appDir, fileName) |
| 331 | if err != nil { |
| 332 | return err |
| 333 | } |
| 334 | |
| 335 | if err := os.Remove(filePath); err != nil { |
| 336 | return fmt.Errorf("failed to delete file: %w", err) |
| 337 | } |
| 338 | |
| 339 | return nil |
| 340 | } |
| 341 | |
| 342 | func ReplaceInAppFile(appId string, fileName string, edits []fileutil.EditSpec) error { |
| 343 | if err := ValidateAppId(appId); err != nil { |
no test coverage detected