2025-02-05 16:25:01 +01:00
|
|
|
#include "process/check_and_fetch_customer_repository_command.h"
|
2025-02-06 16:25:50 +01:00
|
|
|
#include "worker.h"
|
2025-02-14 13:20:42 +01:00
|
|
|
#include "utils_internal.h"
|
2025-02-05 16:25:01 +01:00
|
|
|
|
|
|
|
CheckAndFetchCustomerRepositoryCommand::CheckAndFetchCustomerRepositoryCommand(
|
2025-02-14 13:20:42 +01:00
|
|
|
QString const &command, Worker *worker, int nextCommandIndex,
|
|
|
|
int start_timeout, int finish_timeout)
|
|
|
|
: UpdateCommand(command, worker, nextCommandIndex, start_timeout, finish_timeout) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void CheckAndFetchCustomerRepositoryCommand::finished(int exitCode, QProcess::ExitStatus exitStatus) {
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << command() << exitCode << exitStatus;
|
|
|
|
Worker *w = worker();
|
|
|
|
if (w) {
|
|
|
|
switch (exitCode) {
|
|
|
|
case -2:
|
|
|
|
emit w->showCustRepoStatus(internal::GIT_CUSTOMER_REPO_CHECKOUT_ERROR);
|
|
|
|
break;
|
|
|
|
case -4:
|
|
|
|
emit w->showCustRepoStatus(internal::GIT_CUSTOMER_REPO_PULL_ERROR);
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
emit w->showCustRepoStatus(internal::GIT_CUSTOMER_REPO_UP_TO_DATE);
|
|
|
|
default:;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return UpdateCommand::finished(exitCode, exitStatus);
|
2025-02-05 16:25:01 +01:00
|
|
|
}
|
2025-02-06 16:25:50 +01:00
|
|
|
|
|
|
|
void CheckAndFetchCustomerRepositoryCommand::readyReadStandardOutput() {
|
2025-02-14 13:20:42 +01:00
|
|
|
//QProcess *p = (QProcess *)sender();
|
|
|
|
//if (p) {
|
|
|
|
// Worker *w = worker();
|
|
|
|
// if (w) {
|
|
|
|
// QString s = p->readAllStandardOutput().trimmed();
|
|
|
|
//
|
|
|
|
// qCritical() << __func__ << ":" << __LINE__ << s;
|
2025-02-06 16:25:50 +01:00
|
|
|
|
|
|
|
// static constexpr const char *GIT_CUSTOMER_REPO_UP_TO_DATE{"up to date"};
|
2025-02-14 13:20:42 +01:00
|
|
|
// emit w->showCustRepoStatus(UpdateCommand::GIT_CUSTOMER_REPO_UP_TO_DATE);
|
|
|
|
// }
|
|
|
|
//}
|
2025-02-06 16:25:50 +01:00
|
|
|
}
|