File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
vsintegration/tests/UnitTests Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,19 @@ open System.IO
55open System.Xml .Linq
66open FSharp.Compiler .SourceCodeServices
77
8+ module FileSystemHelpers =
9+ let safeDeleteFile ( path : string ) =
10+ try
11+ File.Delete( path)
12+ with
13+ | _ -> ()
14+
15+ let safeDeleteDirectory ( path : string ) =
16+ try
17+ Directory.Delete( path)
18+ with
19+ | _ -> ()
20+
821type FSharpProject =
922 {
1023 Directory: string
@@ -29,9 +42,10 @@ type FSharpProject =
2942 member this.Dispose () =
3043 // delete each source file
3144 this.Files
32- |> List.iter ( fun ( path , _contents ) -> File.Delete( path))
45+ |> List.map fst
46+ |> List.iter FileSystemHelpers.safeDeleteFile
3347 // delete the directory
34- Directory.Delete ( this.Directory)
48+ FileSystemHelpers.safeDeleteDirectory ( this.Directory)
3549 // project file doesn't really exist, nothing to delete
3650 ()
3751
You can’t perform that action at this time.
0 commit comments