File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -45,10 +45,15 @@ class Dump {
45
45
#endif
46
46
do {
47
47
consoleIO. writeMessage ( " Copy From \( sourceUrl) to \( targetUrl) " )
48
- if fileManager. fileExists ( atPath: targetUrl) {
48
+ var isDirectory : ObjCBool = false
49
+ if fileManager. fileExists ( atPath: targetUrl, isDirectory: & isDirectory) {
49
50
// remove old files to ensure the integrity of the dump
50
- try fileManager. removeItem ( atPath: targetUrl)
51
- consoleIO. writeMessage ( " Success to remove \( targetUrl) " )
51
+ if isDirectory. boolValue && !targetUrl. hasSuffix ( " .app " ) {
52
+ consoleIO. writeMessage ( " \( targetUrl) is a Directory " )
53
+ } else {
54
+ try fileManager. removeItem ( atPath: targetUrl)
55
+ consoleIO. writeMessage ( " Success to remove \( targetUrl) " )
56
+ }
52
57
}
53
58
try fileManager. copyItem ( atPath: sourceUrl, toPath: targetUrl)
54
59
consoleIO. writeMessage ( " Success to copy file. " )
You can’t perform that action at this time.
0 commit comments