Revert "check if origin-update exists"

This reverts commit f4c7d3ecd3.
This commit is contained in:
Jason Wen
2024-05-31 22:27:45 -04:00
parent c661d36c34
commit 9dae5d1659
+2 -8
View File
@@ -47,19 +47,13 @@ int main(int argc, char *argv[]) {
update_btn->setEnabled(false);
update_btn->setText(QObject::tr("Updating..."));
const std::string git_branch = Params().get("GitBranch");
const std::string remote_check = "git remote | grep origin-update";
std::string cmd = "cd /data/openpilot";
const std::string cmd1 = "git remote remove origin-update";
const std::string cmd2 = "git remote add origin-update " + Params().get("GitRemote");
const std::string cmd3 = "git fetch origin-update " + git_branch;
const std::string cmd4 = "git reset --hard origin-update/" + git_branch;
QFuture<void> future = QtConcurrent::run([&]() {
if (!std::system(remote_check.c_str())) {
cmd += " && " + cmd1;
}
cmd += " && " + cmd2 + " && " + cmd3 + " && " + cmd4;
std::system(cmd.c_str());
QFuture<void> future = QtConcurrent::run([=]() {
std::system(("cd /data/openpilot && " + cmd1 + " && " + cmd2 + " && " + cmd3 + " && " + cmd4).c_str());
});
QObject::connect(&watcher, &QFutureWatcher<void>::finished, [=]() {
btn->setEnabled(true);