Skip to content

Commit 74041b8

Browse files
committed
fix test that gets package version from README
- README.txt no longer exists, use same function as in ModelExporter - also remove unused static var FIELD_SEPARATORS
1 parent 0ff9053 commit 74041b8

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

Packages/com.unity.formats.fbx/Editor/Scripts/InstallIntegration.cs

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ public class MayaIntegration : DCCIntegration
9696
private string MODULE_FILENAME { get { return "UnityFbxForMaya"; } }
9797

9898
private const string PACKAGE_NAME = "com.unity.formats.fbx";
99-
private const string VERSION_FILENAME = "README.txt";
10099
private const string VERSION_FIELD = "VERSION";
101100
private const string VERSION_TAG = "{Version}";
102101
private const string PROJECT_TAG = "{UnityProject}";
@@ -155,7 +154,6 @@ protected string MAYA_CONFIG_COMMAND { get {
155154
private string MAYA_CLOSE_COMMAND { get {
156155
return string.Format("scriptJob -idleEvent quit;");
157156
}}
158-
private static Char[] FIELD_SEPARATORS = new Char[] {':'};
159157

160158
protected static string GetUserFolder()
161159
{
@@ -221,38 +219,7 @@ private static string GetUserStartupScriptPath(){
221219

222220
public static string GetPackageVersion()
223221
{
224-
string result = null;
225-
226-
try {
227-
string FileName = System.IO.Path.Combine(GetPackagePath(), VERSION_FILENAME);
228-
229-
System.IO.StreamReader sr = new System.IO.StreamReader(FileName);
230-
231-
// Read the first line of text
232-
string line = sr.ReadLine();
233-
234-
// Continue to read until you reach end of file
235-
while (line != null)
236-
{
237-
if (line.StartsWith(VERSION_FIELD, StringComparison.CurrentCulture))
238-
{
239-
string[] fields = line.Split(FIELD_SEPARATORS);
240-
241-
if (fields.Length>1)
242-
{
243-
result = fields[1];
244-
}
245-
break;
246-
}
247-
line = sr.ReadLine();
248-
}
249-
}
250-
catch(Exception e)
251-
{
252-
Debug.LogError(string.Format("Exception failed to read file containing package version ({0})", e.Message));
253-
}
254-
255-
return result;
222+
return ModelExporter.GetVersionFromReadme();
256223
}
257224

258225
private static List<string> ParseTemplateFile(string FileName, Dictionary<string,string> Tokens )

0 commit comments

Comments
 (0)