Changed handling --console_command_file to use AZ::Console::ExecuteConfigFile
This commit is contained in:
@@ -23,27 +23,9 @@
|
||||
#include <stdio.h>
|
||||
#include "System.h"
|
||||
#include <AzCore/IO/FileIO.h>
|
||||
#include <AzCore/Console/IConsole.h>
|
||||
|
||||
IConsole* CConsoleBatchFile::m_pConsole = NULL;
|
||||
|
||||
namespace
|
||||
{
|
||||
static void exec(const AZ::ConsoleCommandContainer& args)
|
||||
{
|
||||
if (args.size() == 1)
|
||||
{
|
||||
CConsoleBatchFile::ExecuteConfigFile(args.front().data());
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Warning("editor", false, "exec requires exactly one file name.");
|
||||
}
|
||||
}
|
||||
|
||||
AZ_CONSOLEFREEFUNC(exec, AZ::ConsoleFunctorFlags::Null, "Executes a batch file of console commands.");
|
||||
}
|
||||
|
||||
void CConsoleBatchFile::Init()
|
||||
{
|
||||
m_pConsole = gEnv->pConsole;
|
||||
|
||||
@@ -57,8 +57,7 @@ namespace
|
||||
const AZStd::string& consoleCmd = commandLine->GetSwitchValue(customConCmdKey, numSwitchValues - 1);
|
||||
if (!consoleCmd.empty())
|
||||
{
|
||||
AZStd::string execString = "exec " + consoleCmd;
|
||||
AZ::Interface<AZ::IConsole>::Get()->PerformCommand(execString.c_str());
|
||||
AZ::Interface<AZ::IConsole>::Get()->ExecuteConfigFile(consoleCmd.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -654,7 +653,7 @@ namespace O3DELauncher
|
||||
if (gEnv && gEnv->pConsole)
|
||||
{
|
||||
// Execute autoexec.cfg to load the initial level
|
||||
AZ::Interface<AZ::IConsole>::Get()->PerformCommand("exec autoexec.cfg");
|
||||
AZ::Interface<AZ::IConsole>::Get()->ExecuteConfigFile("autoexec.cfg");
|
||||
|
||||
// Find out if console command file was passed
|
||||
// via --console_command_file=%filename% and execute it
|
||||
|
||||
Reference in New Issue
Block a user