From def078495a03a1793bc4be9395071080b932c01b Mon Sep 17 00:00:00 2001 From: Dave Hogan Date: Fri, 6 Nov 2015 21:23:29 +0000 Subject: [PATCH] Create directory only where required - Issue #996 --- src/app/FakeLib/AssemblyInfoFile.fs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/FakeLib/AssemblyInfoFile.fs b/src/app/FakeLib/AssemblyInfoFile.fs index 7e423844d02..b863c90575e 100644 --- a/src/app/FakeLib/AssemblyInfoFile.fs +++ b/src/app/FakeLib/AssemblyInfoFile.fs @@ -101,7 +101,9 @@ type Attribute(name, value, inNamespace) = let private writeToFile outputFileName (lines : seq) = let fi = fileInfo outputFileName if fi.Exists then fi.Delete() - System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(outputFileName)) |> ignore + let dirName = System.IO.Path.GetDirectoryName(outputFileName) + if not (isNullOrEmpty dirName) then + System.IO.Directory.CreateDirectory(dirName) |> ignore use writer = new System.IO.StreamWriter(outputFileName, false, System.Text.Encoding.UTF8) lines |> Seq.iter writer.WriteLine tracefn "Created AssemblyInfo file \"%s\"." outputFileName