[LYN-2151] Add argument to override aws profile and config file path (#994)
This commit is contained in:
@@ -58,6 +58,19 @@ namespace AWSCore
|
||||
return configFilePath;
|
||||
}
|
||||
|
||||
AZStd::string AWSCoreConfiguration::GetResourceMappingConfigFolderPath() const
|
||||
{
|
||||
if (m_sourceProjectFolder.empty())
|
||||
{
|
||||
AZ_Warning(AWSCoreConfigurationName, false, ProjectSourceFolderNotFoundErrorMessage);
|
||||
return "";
|
||||
}
|
||||
AZStd::string configFolderPath = AZStd::string::format(
|
||||
"%s/%s", m_sourceProjectFolder.c_str(), AWSCoreResourceMappingConfigFolderName);
|
||||
AzFramework::StringFunc::Path::Normalize(configFolderPath);
|
||||
return configFolderPath;
|
||||
}
|
||||
|
||||
void AWSCoreConfiguration::InitConfig()
|
||||
{
|
||||
InitSourceProjectFolderPath();
|
||||
@@ -123,7 +136,7 @@ namespace AWSCore
|
||||
auto profileNamePath = AZStd::string::format("%s%s",
|
||||
AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreProfileNameKey);
|
||||
m_settingsRegistry.Remove(profileNamePath);
|
||||
m_profileName.clear();
|
||||
m_profileName = AWSCoreDefaultProfileName;
|
||||
|
||||
auto resourceMappingConfigFileNamePath = AZStd::string::format("%s%s",
|
||||
AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreResourceMappingConfigFileNameKey);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
|
||||
#include <AWSCoreInternalBus.h>
|
||||
#include <Editor/UI/AWSCoreResourceMappingToolAction.h>
|
||||
|
||||
namespace AWSCore
|
||||
@@ -108,17 +109,24 @@ namespace AWSCore
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
AZStd::string profileName = "default";
|
||||
AWSCoreInternalRequestBus::BroadcastResult(profileName, &AWSCoreInternalRequests::GetProfileName);
|
||||
|
||||
AZStd::string configPath = "";
|
||||
AWSCoreInternalRequestBus::BroadcastResult(configPath, &AWSCoreInternalRequests::GetResourceMappingConfigFolderPath);
|
||||
|
||||
if (m_isDebug)
|
||||
{
|
||||
return AZStd::string::format(
|
||||
"%s debug %s --binaries_path %s --debug",
|
||||
m_enginePythonEntryPath.c_str(), m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str());
|
||||
"%s debug %s --binaries_path %s --debug --profile %s --config_path %s", m_enginePythonEntryPath.c_str(),
|
||||
m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str(), profileName.c_str(), configPath.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
return AZStd::string::format(
|
||||
"%s %s --binaries_path %s",
|
||||
m_enginePythonEntryPath.c_str(), m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str());
|
||||
"%s %s --binaries_path %s --profile %s --config_path %s", m_enginePythonEntryPath.c_str(),
|
||||
m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str(), profileName.c_str(), configPath.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user