diff --git a/UnityPackager.Tests/PackerTest.cs b/UnityPackager.Tests/PackerTest.cs index 867c0a1..80babcb 100644 --- a/UnityPackager.Tests/PackerTest.cs +++ b/UnityPackager.Tests/PackerTest.cs @@ -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] @@ -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) diff --git a/UnityPackager.Tests/sample/childfolder/sample2.txt.meta b/UnityPackager.Tests/sample/childfolder/sample2.txt.meta index 737a855..3e12e82 100644 --- a/UnityPackager.Tests/sample/childfolder/sample2.txt.meta +++ b/UnityPackager.Tests/sample/childfolder/sample2.txt.meta @@ -1,3 +1,11 @@ -guid: F97417BE8FA0C9BF60F86625A5ABDE62 fileFormatVersion: 2 -somethingelse: 3 +guid: 0aa3018bb284840d6a6d0acee29ab098 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/UnityPackager/Packer.cs b/UnityPackager/Packer.cs index 062d3a2..ed019db 100644 --- a/UnityPackager/Packer.cs +++ b/UnityPackager/Packer.cs @@ -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);