Skip to content

Commit

Permalink
Merge pull request #997 from DaveHogan/EmptyDirAssemblyInfoFile
Browse files Browse the repository at this point in the history
Create directory only where required
  • Loading branch information
forki committed Nov 11, 2015
2 parents 545fb5d + def0784 commit db138cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/FakeLib/AssemblyInfoFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ type Attribute(name, value, inNamespace) =
let private writeToFile outputFileName (lines : seq<string>) =
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
Expand Down

0 comments on commit db138cf

Please sign in to comment.