Skip to content

Commit

Permalink
Don't touch app.config if we don't logically change it - references #…
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Dec 3, 2015
1 parent 40aa272 commit 9100cdf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.32.5 - 03.12.2015
* Don't touch app.config if we don't logically change it - https://github.com/fsprojects/Paket/issues/1248

#### 2.32.4 - 03.12.2015
* Normalize versions in lock file for nuget.org - https://github.com/fsprojects/Paket/issues/1282

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<!-- Google apps API keys -->
<add key="GoogleAppMigrationWizProjectApiKey-1" value="key1" />
<add key="GoogleAppMigrationWizProjectApiKey-2" value="key2" />
<add key="GoogleAppMigrationWizProjectApiKey-3" value="key3" />
<add key="SendEmails" value="false" />
<add key="GoogleAppMigrationWizProjectApiKey-3" value="key3"/>
<add key="SendEmails" value="false"/>
<add key="BitTitanDropBoxAppKey" value="BitTitan" />
<add key="BitTitanDropBoxSecretKey" value="BitTitan" />
</appSettings>
Expand Down
7 changes: 5 additions & 2 deletions src/Paket.Core/BindingRedirects.fs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ let internal indentAssemblyBindings config =
let xmlWriterSettings = XmlWriterSettings()
xmlWriterSettings.Indent <- true
use writer = XmlWriter.Create(sb, xmlWriterSettings)

let tempAssemblyBindingNode = XElement.Parse(assemblyBinding.ToString())
tempAssemblyBindingNode.WriteTo writer
writer.Close()
Expand Down Expand Up @@ -124,6 +123,8 @@ let private applyBindingRedirects isFirstGroup cleanBindingRedirects bindingRedi
with
| exn -> failwithf "Parsing of %s failed.%s%s" configFilePath Environment.NewLine exn.Message

let original = config.ToString(SaveOptions.None)

let isMarked e =
match tryGetElement (Some bindingNs) "Paket" e with
| Some e -> e.Value.Trim().ToLower() = "true"
Expand All @@ -139,7 +140,9 @@ let private applyBindingRedirects isFirstGroup cleanBindingRedirects bindingRedi

let config = Seq.fold setRedirect config bindingRedirects
indentAssemblyBindings config
config.Save configFilePath
let newText = config.ToString(SaveOptions.None)
if newText <> original then
config.Save(configFilePath, SaveOptions.DisableFormatting)

/// Applies a set of binding redirects to all .config files in a specific folder.
let applyBindingRedirectsToFolder isFirstGroup createNewBindingFiles cleanBindingRedirects rootPath bindingRedirects =
Expand Down

0 comments on commit 9100cdf

Please sign in to comment.