mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-28 15:40:56 +01:00
Config option and cli command
This commit is contained in:
@@ -9,7 +9,7 @@ namespace TGCommandLine
|
||||
public RepoCommand()
|
||||
{
|
||||
Keyword = "repo";
|
||||
Children = new Command[] { new RepoSetupCommand(), new RepoUpdateCommand(), new RepoGenChangelogCommand(), new RepoPushChangelogCommand(), new RepoPythonPathCommand(), new RepoSetEmailCommand(), new RepoSetNameCommand(), new RepoMergePRCommand(), new RepoListPRsCommand(), new RepoStatusCommand(), new RepoListBackupsCommand(), new RepoCheckoutCommand(), new RepoResetCommand(), new RepoUpdateJsonCommand() };
|
||||
Children = new Command[] { new RepoSetupCommand(), new RepoUpdateCommand(), new RepoGenChangelogCommand(), new RepoPushChangelogCommand(), new RepoPythonPathCommand(), new RepoSetEmailCommand(), new RepoSetNameCommand(), new RepoMergePRCommand(), new RepoListPRsCommand(), new RepoStatusCommand(), new RepoListBackupsCommand(), new RepoCheckoutCommand(), new RepoResetCommand(), new RepoUpdateJsonCommand(), new RepoSetPushTestmergeCommitsCommand() };
|
||||
}
|
||||
public override string GetHelpText()
|
||||
{
|
||||
@@ -17,6 +17,41 @@ namespace TGCommandLine
|
||||
}
|
||||
}
|
||||
|
||||
class RepoSetPushTestmergeCommitsCommand : Command
|
||||
{
|
||||
public RepoSetPushTestmergeCommitsCommand()
|
||||
{
|
||||
Keyword = "push-testmerges";
|
||||
RequiredParameters = 1;
|
||||
}
|
||||
public override string GetHelpText()
|
||||
{
|
||||
return "Set if a temporary branch is to the remote when we make testmerge commits and then delete it";
|
||||
}
|
||||
|
||||
public override string GetArgumentString()
|
||||
{
|
||||
return "<on|off>";
|
||||
}
|
||||
|
||||
protected override ExitCode Run(IList<string> parameters)
|
||||
{
|
||||
switch (parameters[0].ToLower())
|
||||
{
|
||||
case "on":
|
||||
Server.GetComponent<ITGRepository>().SetPushTestmergeCommits(true);
|
||||
break;
|
||||
case "off":
|
||||
Server.GetComponent<ITGRepository>().SetPushTestmergeCommits(false);
|
||||
break;
|
||||
default:
|
||||
OutputProc("Invalid option!");
|
||||
return ExitCode.BadCommand;
|
||||
}
|
||||
return ExitCode.Normal;
|
||||
}
|
||||
}
|
||||
|
||||
class RepoUpdateJsonCommand : Command
|
||||
{
|
||||
public RepoUpdateJsonCommand()
|
||||
@@ -97,6 +132,7 @@ namespace TGCommandLine
|
||||
OutputProc("Remote: " + remote + " (" + remotehead + ")");
|
||||
OutputProc("Branch: " + branch);
|
||||
OutputProc("HEAD: " + head);
|
||||
OutputProc("Push testmerge commits: " + (Repo.PushTestmergeCommits() ? "ON" : "OFF"));
|
||||
OutputProc(String.Format("Committer Identity: {0} ({1})", Repo.GetCommitterName(), Repo.GetCommitterEmail()));
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user