fix build?

This commit is contained in:
alyssa 2025-01-05 04:54:40 +00:00
parent 57ae3b5e49
commit c755124900
4 changed files with 10 additions and 2 deletions

View file

@ -67,6 +67,7 @@ public class Misc
{
var content = $"Stats unavailable (is scheduled_tasks service running?)\n\n**Quick info:**"
+ $"\nPluralKit [{BuildInfoService.Version}](<https://github.com/pluralkit/pluralkit/commit/{BuildInfoService.FullVersion}>)"
+ (BuildInfoService.IsDev ? ", **development build**" : "")
+ $"\nCurrently on shard {ctx.ShardId}, {shardsUp}/{shards.Count()} shards up,"
+ $" API latency: {apiLatency.TotalMilliseconds:F0}ms";
await ctx.Rest.EditMessage(msg.ChannelId, msg.Id,

View file

@ -57,7 +57,7 @@
</ItemGroup>
<Target Name="SetSourceRevisionId" BeforeTargets="InitializeSourceControlInformation">
<Exec Command="git rev-parse HEAD &gt; ../.version &amp; git show --no-patch --format=%at $(git rev-parse HEAD) &gt;&gt; ../.version &amp; (git diff-index --quiet HEAD -- &amp;&amp; echo 1) &gt;&gt; ../.version" IgnoreExitCode="True">
<Exec Command="../ci/dotnet-version.sh" IgnoreExitCode="False">
</Exec>
</Target>

View file

@ -18,7 +18,7 @@ public static class BuildInfoService
FullVersion = data[0];
Timestamp = data[1];
IsDev = data[2] == "";
IsDev = data.Length < 3 || data[2] == "";
// show only short commit hash to users
Version = FullVersion.Remove(7);

7
ci/dotnet-version.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
rm ../.version || true
touch ../.version
git rev-parse HEAD >> ../.version
git show --no-patch --format=%at $(git rev-parse HEAD) >> ../.version
(git diff-index --quiet HEAD -- && echo 1) >> ../.version || true