File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -494,7 +494,17 @@ private struct LocalFileSystem: FileSystem {
494
494
// Don't fail if path is already a directory.
495
495
if isDirectory ( path) { return }
496
496
497
- try FileManager . default. createDirectory ( atPath: path. pathString, withIntermediateDirectories: recursive, attributes: [ : ] )
497
+ do {
498
+ try FileManager . default. createDirectory ( atPath: path. pathString, withIntermediateDirectories: recursive, attributes: [ : ] )
499
+ } catch {
500
+ if isDirectory ( path) {
501
+ // `createDirectory` failed but we have a directory now. This might happen if the directory is created
502
+ // by another process between the check above and the call to `createDirectory`.
503
+ // Since we have the expected end result, this is fine.
504
+ return
505
+ }
506
+ throw error
507
+ }
498
508
}
499
509
500
510
func createSymbolicLink( _ path: AbsolutePath , pointingAt destination: AbsolutePath , relative: Bool ) throws {
You can’t perform that action at this time.
0 commit comments