We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent daf7754 commit 9f14df9Copy full SHA for 9f14df9
Sources/XcodeProjectCLI/Subcommands/Groups/MoveGroupCommand.swift
@@ -83,8 +83,11 @@ struct MoveGroupCommand: ParsableCommand {
83
}
84
} else {
85
if fileManager.fileExists(atPath: destPath) {
86
- try fileManager.removeItem(atPath: sourcePath)
87
- print("Warning: File \(item) already exists at destination. Source file has been removed.")
+ let bakPath = destPath.asInputPath.changeLastComponent(
+ to: "\(destPath.asInputPath.lastComponent).bak"
88
+ ).absolutePath
89
+ try fileManager.moveItem(atPath: sourcePath, toPath: bakPath)
90
+ print("Warning: File \(item) already exists at destination. Backup created at \(bakPath).")
91
92
try fileManager.moveItem(atPath: sourcePath, toPath: destPath)
93
0 commit comments