ARTEMIS-4974 Removing Run from Shell

This commit is contained in:
Clebert Suconic 2024-08-06 11:55:58 -04:00 committed by Robbie Gemmell
parent be4995a530
commit 5ab9765345
2 changed files with 4 additions and 14 deletions

View File

@ -284,7 +284,10 @@ public class Artemis implements Runnable {
commandLine.addSubcommand(new DataGroup(commandLine));
commandLine.addSubcommand(new UserGroup(commandLine));
commandLine.addSubcommand(new Run());
if (!Shell.inShell()) {
commandLine.addSubcommand(new Run());
}
commandLine.addSubcommand(new Stop());
commandLine.addSubcommand(new Kill());
commandLine.addSubcommand(new PerfJournal());

View File

@ -24,8 +24,6 @@ import java.util.concurrent.atomic.AtomicReference;
import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
import org.apache.activemq.artemis.api.core.Pair;
import org.apache.activemq.artemis.cli.Artemis;
import org.apache.activemq.artemis.cli.Shell;
import org.apache.activemq.artemis.cli.Terminal;
import org.apache.activemq.artemis.cli.commands.tools.LockAbstract;
import org.apache.activemq.artemis.cli.factory.BrokerFactory;
import org.apache.activemq.artemis.cli.factory.jmx.ManagementFactory;
@ -76,17 +74,6 @@ public class Run extends LockAbstract {
@Override
public Object execute(ActionContext context) throws Exception {
if (Shell.inShell()) {
String scriptStart = "./artemis";
if (System.getProperty("os.name", "linux").toLowerCase().trim().startsWith("win")) {
scriptStart = "artemis.cmd";
}
System.out.println(Terminal.RED_UNICODE + "ERROR: The run command is not supported in the artemis shell. Please use '" + scriptStart + " run' directly." + Terminal.CLEAR_UNICODE);
return null;
}
super.execute(context);
verifyOlderLogging(new File(getBrokerEtc()));