We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08f347a commit 200d85aCopy full SHA for 200d85a
src/dotnet-proj-info/Inspect.fs
@@ -114,8 +114,20 @@ let writeTargetFile log templates targetFileDestPath =
114
</Project>
115
"""
116
117
- log (sprintf "writing helper target file in '%s'" targetFileDestPath)
118
- File.WriteAllText(targetFileDestPath, targetFileTemplate.Trim())
+ let targetFileOnDisk =
+ if File.Exists(targetFileDestPath) then
119
+ try
120
+ Some (File.ReadAllText targetFileDestPath)
121
+ with
122
+ | _ -> None
123
+ else
124
+ None
125
+
126
+ let newTargetFile = targetFileTemplate.Trim()
127
128
+ if targetFileOnDisk <> Some newTargetFile then
129
+ log (sprintf "writing helper target file in '%s'" targetFileDestPath)
130
+ File.WriteAllText(targetFileDestPath, newTargetFile)
131
132
Ok targetFileDestPath
133
0 commit comments