mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-21 19:55:00 +00:00
53 lines
1.2 KiB
Java
53 lines
1.2 KiB
Java
package com.volmit.iris.command;
|
|
|
|
import com.volmit.iris.Iris;
|
|
import com.volmit.iris.IrisSettings;
|
|
import com.volmit.iris.manager.IrisProject;
|
|
import com.volmit.iris.util.MortarCommand;
|
|
import com.volmit.iris.util.MortarSender;
|
|
|
|
public class CommandIrisStudioUpdate extends MortarCommand
|
|
{
|
|
public CommandIrisStudioUpdate()
|
|
{
|
|
super("update", "upd", "u");
|
|
requiresPermission(Iris.perm.studio);
|
|
setDescription("Update your dimension project.");
|
|
setCategory("Studio");
|
|
}
|
|
|
|
@Override
|
|
public boolean handle(MortarSender sender, String[] args)
|
|
{
|
|
if(!IrisSettings.get().isStudio())
|
|
{
|
|
sender.sendMessage("To use Iris Studio, please enable studio in Iris/settings.json");
|
|
return true;
|
|
}
|
|
|
|
if(args.length == 0)
|
|
{
|
|
sender.sendMessage("/iris std package <DIMENSION>");
|
|
return true;
|
|
}
|
|
|
|
if(new IrisProject(Iris.proj.getWorkspaceFolder(args[0])).updateWorkspace())
|
|
{
|
|
sender.sendMessage("Updated Code Workspace for " + args[0]);
|
|
}
|
|
|
|
else
|
|
{
|
|
sender.sendMessage("Invalid project: " + args[0] + ". Try deleting the code-workspace file and try again.");
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
protected String getArgsUsage()
|
|
{
|
|
return "[dimension]";
|
|
}
|
|
}
|