Exposed exec console command to AZ Console

This commit is contained in:
pereslav
2021-04-26 21:30:52 +01:00
parent 1db6c9236a
commit 2b77d43435
@@ -23,9 +23,27 @@
#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;