Skip to content

Commit

Permalink
Merge pull request #97 from OctopusDeploy/bug-confScriptUnicode
Browse files Browse the repository at this point in the history
When writing configured-scripts for package-steps to disk, add UTF8 BOM.
  • Loading branch information
MJRichardson committed Mar 18, 2016
2 parents fa6cdb8 + f98cf97 commit 9650e80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.IO;
using System.Text;
using Calamari.Deployment;
using Calamari.Deployment.Conventions;
using Calamari.Integration.FileSystem;
using Calamari.Integration.Processes;
using Calamari.Integration.Scripting;
using NSubstitute;
using NUnit.Framework;
using Octostache;

namespace Calamari.Tests.Fixtures.Conventions
{
Expand Down Expand Up @@ -48,7 +48,7 @@ public void ShouldRunScriptAtAppropriateStage()
scriptEngine.Execute(scriptPath, variables, commandLineRunner).Returns(new CommandResult("", 0));
convention.Install(deployment);

fileSystem.Received().OverwriteFile(scriptPath, scriptBody);
fileSystem.Received().OverwriteFile(scriptPath, scriptBody, Encoding.UTF8);
scriptEngine.Received().Execute(scriptPath, variables, commandLineRunner);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.IO;
using System.Linq;
using System.Text;
using Calamari.Commands.Support;
using Calamari.Integration.FileSystem;
using Calamari.Integration.Processes;
Expand Down Expand Up @@ -43,7 +44,7 @@ public void Install(RunningDeployment deployment)

var scriptFile = Path.Combine(deployment.CurrentDirectory, scriptName);

fileSystem.OverwriteFile(scriptFile, scriptBody);
fileSystem.OverwriteFile(scriptFile, scriptBody, Encoding.UTF8);

// Execute the script
Log.VerboseFormat("Executing '{0}'", scriptFile);
Expand Down

0 comments on commit 9650e80

Please sign in to comment.