Compilation is blocked if TGS3.json changes. Adds command/button to update it

This commit is contained in:
Cyberboss
2017-09-27 11:05:41 -04:00
parent 141d4eec26
commit edffc6be3e
8 changed files with 164 additions and 76 deletions
+25 -1
View File
@@ -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() };
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() };
}
public override string GetHelpText()
{
@@ -17,6 +17,30 @@ namespace TGCommandLine
}
}
class RepoUpdateJsonCommand : Command
{
public RepoUpdateJsonCommand()
{
Keyword = "update-json";
}
public override string GetHelpText()
{
return "Updates the cached TGS3.json with the one from the repo. Compilation is blocked if these two do not match.";
}
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGRepository>().UpdateTGS3Json();
if (res != null)
{
OutputProc(res);
return ExitCode.ServerError;
}
return ExitCode.Normal;
}
}
class RepoSetupCommand : Command
{
public RepoSetupCommand()