mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-31 17:43:47 +00:00
feat(CORE): implemented AC_DISABLE_INTERACTIVE for DBUpdater (#13450)
Implement AC_DISABLE_INTERACTIVE that allow us to skip the question when the db doesn't exit
This commit is contained in:
@@ -18,6 +18,8 @@ x-cache-from: &cache-from
|
|||||||
x-ac-shared-conf: &ac-shared-conf
|
x-ac-shared-conf: &ac-shared-conf
|
||||||
<<: *networks
|
<<: *networks
|
||||||
working_dir: /azerothcore
|
working_dir: /azerothcore
|
||||||
|
environment:
|
||||||
|
AC_DISABLE_INTERACTIVE: "1"
|
||||||
depends_on:
|
depends_on:
|
||||||
ac-database:
|
ac-database:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
@@ -170,11 +170,13 @@ BaseLocation DBUpdater<T>::GetBaseLocationType()
|
|||||||
template<class T>
|
template<class T>
|
||||||
bool DBUpdater<T>::Create(DatabaseWorkerPool<T>& pool)
|
bool DBUpdater<T>::Create(DatabaseWorkerPool<T>& pool)
|
||||||
{
|
{
|
||||||
LOG_WARN("sql.updates", "Database \"{}\" does not exist, do you want to create it? [yes (default) / no]: ",
|
LOG_WARN("sql.updates", "Database \"{}\" does not exist", pool.GetConnectionInfo()->database);
|
||||||
pool.GetConnectionInfo()->database);
|
|
||||||
|
|
||||||
if (!sConfigMgr->isDryRun())
|
const char* interactiveOpt = std::getenv("AC_DISABLE_INTERACTIVE");
|
||||||
|
|
||||||
|
if (!sConfigMgr->isDryRun() && std::strcmp(interactiveOpt, "1") != 0)
|
||||||
{
|
{
|
||||||
|
std::cout << "Do you want to create it? [yes (default) / no]:" << std::endl;
|
||||||
std::string answer;
|
std::string answer;
|
||||||
std::getline(std::cin, answer);
|
std::getline(std::cin, answer);
|
||||||
if (!answer.empty() && !(answer.substr(0, 1) == "y"))
|
if (!answer.empty() && !(answer.substr(0, 1) == "y"))
|
||||||
|
|||||||
Reference in New Issue
Block a user