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 {
4545 #endif
4646 do {
4747 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) {
4950 // 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+ }
5257 }
5358 try fileManager. copyItem ( atPath: sourceUrl, toPath: targetUrl)
5459 consoleIO. writeMessage ( " Success to copy file. " )
You can’t perform that action at this time.
0 commit comments