Skip to content

Commit

Permalink
Merge pull request #9 from paulpach/anchors
Browse files Browse the repository at this point in the history
fix: do not add introduce yaml anchors
  • Loading branch information
TwoTenPvP authored Mar 31, 2019
2 parents c2e70a2 + 106e226 commit cb7a7a9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
7 changes: 5 additions & 2 deletions UnityPackager.Tests/PackerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public void PackTest()
Assert.Equal("A6-04-78-87-FC-41-65-97-76-D5-CB-4A-18-2F-33-7A", BitConverter.ToString(md5));

string meta2 = File.ReadAllText("sample_out/sample2.txt.meta");
Assert.True(meta2.Contains("somethingelse"), "Packer should preserve our custom yaml files");
Assert.True(meta2.Contains("serializedVersion: 2"), "Packer should preserve our custom yaml files");
Assert.True(meta2.Contains("fileFormatVersion: 2"), "Packer should preserve file format");
}

[Fact]
Expand All @@ -65,7 +66,9 @@ public void RecursivePackTest()
Assert.True(File.Exists("rsample_out/Assets/UnityPacker/box.png.meta"), "box.meta should have been decompressed");

string meta2 = File.ReadAllText("rsample_out/Assets/UnityPacker/childfolder/sample2.txt.meta");
Assert.True(meta2.Contains("somethingelse"), "Packer should preserve our custom yaml files");
Assert.True(meta2.Contains("serializedVersion: 2"), "Packer should preserve our custom yaml files");
Assert.True(meta2.Contains("fileFormatVersion: 2"), "Packer should preserve file format");

}

private static byte[] GetMD5(string file)
Expand Down
12 changes: 10 additions & 2 deletions UnityPackager.Tests/sample/childfolder/sample2.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion UnityPackager/Packer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private static void SaveMeta(string metaPath, YamlDocument meta)
{
using (StreamWriter writer = new StreamWriter(metaPath))
{
new YamlStream(meta).Save(writer);
new YamlStream(meta).Save(writer, false);
}

FileInfo metaFile = new FileInfo(metaPath);
Expand Down

0 comments on commit cb7a7a9

Please sign in to comment.