mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 07:04:57 +01:00
38 lines
804 B
C#
38 lines
804 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace TGServerService.ChatCommands
|
|
{
|
|
/// <summary>
|
|
/// Retrieves the git SHA of the live DreamDaemon code
|
|
/// </summary>
|
|
sealed class RevisionCommand : ChatCommand
|
|
{
|
|
/// <summary>
|
|
/// Construct a <see cref="RevisionCommand"/>
|
|
/// </summary>
|
|
public RevisionCommand()
|
|
{
|
|
Keyword = "revision";
|
|
}
|
|
/// <inheritdoc />
|
|
protected override ExitCode Run(IList<string> parameters)
|
|
{
|
|
var res = Instance.LiveSha();
|
|
if (res == "UNKNOWN")
|
|
{
|
|
OutputProc(res);
|
|
return ExitCode.ServerError;
|
|
}
|
|
OutputProc(String.Format("^{0}", res));
|
|
return ExitCode.Normal;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override string GetHelpText()
|
|
{
|
|
return "Prints the current code revision of the repository (not the server)";
|
|
}
|
|
}
|
|
}
|