File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -423,7 +423,9 @@ public class Workspace {
423
423
424
424
/// The default location of the git repository cache
425
425
let repositoriesPath : AbsolutePath = {
426
- let cacheURL = FileManager . default. urls ( for: . cachesDirectory, in: . userDomainMask) . first!
426
+ guard let cacheURL = FileManager . default. urls ( for: . cachesDirectory, in: . userDomainMask) . first else {
427
+ return localFileSystem. homeDirectory. appending ( components: " .swiftpm " , " repositories " )
428
+ }
427
429
return AbsolutePath ( cacheURL. path) . appending ( components: " org.swift.swiftpm " , " repositories " )
428
430
} ( )
429
431
@@ -590,7 +592,6 @@ extension Workspace {
590
592
591
593
// These are the things we don't want to remove while cleaning.
592
594
let protectedAssets = [
593
- repositoryManager. path,
594
595
checkoutsPath,
595
596
artifactsPath,
596
597
state. path,
@@ -632,6 +633,7 @@ extension Workspace {
632
633
633
634
repositoryManager. reset ( )
634
635
try ? fileSystem. removeFileTree ( dataPath)
636
+ try ? fileSystem. removeFileTree ( repositoryManager. path)
635
637
}
636
638
637
639
/// Cancel the active dependency resolution operation.
You can’t perform that action at this time.
0 commit comments