diff --git a/Foxchat.Core/BuildInfo.cs b/Foxchat.Core/BuildInfo.cs index 4d620b9..f7f6207 100644 --- a/Foxchat.Core/BuildInfo.cs +++ b/Foxchat.Core/BuildInfo.cs @@ -12,11 +12,13 @@ public static class BuildInfo using var reader = new StreamReader(stream); var data = (await reader.ReadToEndAsync()).Trim().Split("\n"); + if (data.Length < 3) return; Hash = data[0]; var dirty = data[2] == "dirty"; var versionData = data[1].Split("-"); + if (versionData.Length < 3) return; Version = versionData[0]; if (versionData[1] != "0" || dirty) Version += $"+{versionData[2]}"; if (dirty) Version += ".dirty"; diff --git a/build_info.sh b/build_info.sh index cc7ee0b..c644a3c 100755 --- a/build_info.sh +++ b/build_info.sh @@ -1,4 +1,4 @@ #!/bin/sh (git rev-parse HEAD && - git describe --tags --long && + git describe --tags --always --long && if test -z "$(git ls-files --exclude-standard --modified --deleted --others)"; then echo clean; else echo dirty; fi) > ../.version