fix for linux

This commit is contained in:
Roy Qu 2024-04-02 20:37:28 +08:00
parent bae58f8ddf
commit 7fedf86d4e
2 changed files with 8 additions and 1 deletions

View File

@ -1242,7 +1242,7 @@ void MainWindow::executeTool(PToolItem item)
break;
}
QString command;
#ifdef Q_OS_WIN
if (!fileExists(program)) {
QTemporaryFile file(QDir::tempPath()+QDir::separator()+"XXXXXX.bat");
file.setAutoRemove(false);
@ -1262,9 +1262,12 @@ void MainWindow::executeTool(PToolItem item)
output = runAndGetOutput(cmd, workDir, args, inputContent);
}
} else {
#endif
command = escapeCommandForPlatformShell(program, params);
output = runAndGetOutput(program, workDir, params, inputContent);
#ifdef Q_OS_WIN
}
#endif
switch(item->outputTarget) {
case ToolItemOutputTarget::RedirectToToolsOutputPanel:
logToolsOutput(tr(" - Command: %1").arg(command));

View File

@ -44,7 +44,11 @@ void ToolsManager::load()
item->program = "rm";
#endif
item->workingDirectory = "<SOURCEPATH>";
#ifdef Q_OS_WIN
item->parameters = "/q /f <EXENAME>";
#else
item->parameters = "-f <EXENAME>";
#endif
item->inputOrigin = ToolItemInputOrigin::None;
item->outputTarget = ToolItemOutputTarget::RedirectToToolsOutputPanel;
item->isUTF8 = false;