mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 16:39:21 +01:00
Split the service and server functions
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TGS.Server.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)";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user