Skip to content

Commit 7e5ed1f

Browse files
committed
Allow the version to be specified in version.txt instead
1 parent d398142 commit 7e5ed1f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

eng/build/Build.Website.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,11 @@ await GetAuthorsContents().ToListAsync()
109109
jsonVersions[i == versions.Length - 1 ? "current" : version.Name] = new JsonVersion(
110110
version.Changelog is { } changelog
111111
? GetVersionFromChangelog(changelog)
112-
: Git($"describe --tags --abbrev=0", version.Path)
113-
.First(x => x.Type == OutputType.Std)
114-
.Text.Trim(),
112+
: File.Exists(version.Path / "version.txt")
113+
? File.ReadAllText(version.Path / "version.txt")
114+
: Git($"describe --tags --abbrev=0", version.Path)
115+
.First(x => x.Type == OutputType.Std)
116+
.Text.Trim(),
115117
i == versions.Length - 1 ? version.Name : null
116118
);
117119
}

0 commit comments

Comments
 (0)