MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / executeCommand

Method executeCommand

src/plugins/console/consolemanager.cpp:212–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212void ConsoleManager::executeCommand(const QString &name, const QString &program, const QStringList &args, const QString &workingDir, const QStringList &env)
213{
214 auto startNow = env.isEmpty(); // console start after set environment
215 auto console = createConsole(name, startNow);
216 if (!env.isEmpty()) {
217 console->setEnvironment(env);
218 console->startShellProgram();
219 }
220
221 auto dir = workingDir;
222 if (!dir.isEmpty() && QFile::exists(dir)) {
223 console->changeDir(dir);
224 console->sendText("clear\n");
225 }
226
227 QString cmd = program + ' ';
228 cmd += args.join(' ') + '\n';
229 console->sendText(cmd);
230}
231
232QUuid ConsoleManager::newConsole(const QString &name, bool rename)
233{

Callers 4

runningMethod · 0.45
installMethod · 0.45
installMethod · 0.45
installCondaMethod · 0.45

Calls 5

startShellProgramMethod · 0.80
changeDirMethod · 0.80
isEmptyMethod · 0.45
setEnvironmentMethod · 0.45
sendTextMethod · 0.45

Tested by

no test coverage detected