Skip to content

Commit

Permalink
Always Directory.Create() immediately before File.WriteAllText
Browse files Browse the repository at this point in the history
This wasn't actually causing a bug but this makes the functions to create
fsharp and csharp scripts more consistent, and it's confusing if the code
relies on file creation order for fsharp scripts but not csharp scripts
  • Loading branch information
jamesjrg committed Dec 15, 2016
1 parent c569751 commit b957295
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Paket.Core/ScriptGeneration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ module ScriptGeneration =
pieces
|> String.concat ("\n")


scriptFile.Directory.Create()
File.WriteAllText(scriptFile.FullName, text)

let writeCSharpScript scriptFile input =
Expand Down Expand Up @@ -316,7 +318,6 @@ module ScriptGeneration =
match scriptGenerator scriptInfo with
| DoNotGenerate -> knownIncludeScripts
| Generate pieces ->
scriptFile.Directory.Create()
writeScript scriptFile pieces
knownIncludeScripts |> Map.add package.Name scriptFile

Expand Down

0 comments on commit b957295

Please sign in to comment.