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:
parent
9cda0bb2e6
commit
636df19514
@ -18,6 +18,8 @@ x-cache-from: &cache-from
|
||||
x-ac-shared-conf: &ac-shared-conf
|
||||
<<: *networks
|
||||
working_dir: /azerothcore
|
||||
environment:
|
||||
AC_DISABLE_INTERACTIVE: "1"
|
||||
depends_on:
|
||||
ac-database:
|
||||
condition: service_healthy
|
||||
|
||||
@ -170,11 +170,13 @@ BaseLocation DBUpdater<T>::GetBaseLocationType()
|
||||
template<class T>
|
||||
bool DBUpdater<T>::Create(DatabaseWorkerPool<T>& pool)
|
||||
{
|
||||
LOG_WARN("sql.updates", "Database \"{}\" does not exist, do you want to create it? [yes (default) / no]: ",
|
||||
pool.GetConnectionInfo()->database);
|
||||
LOG_WARN("sql.updates", "Database \"{}\" does not exist", 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::getline(std::cin, answer);
|
||||
if (!answer.empty() && !(answer.substr(0, 1) == "y"))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user