Skip to content

Commit

Permalink
leave out version if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
lionkor committed Jan 8, 2024
1 parent f0861f7 commit eda78f7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Update.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include "Update.h"
#include "Common.h"
#include <algorithm>
#include <boost/predef.h>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <filesystem>
#include <httplib.h>
#include <nlohmann/json.hpp>
#include <boost/predef.h>

#if defined(__linux)
#include <unistd.h>
Expand Down Expand Up @@ -122,14 +122,20 @@ void Update::PerformUpdate(const std::string& InvokedAs) {
}
}
beammp_infof("Distribution: {} {}", DistroID, DistroVersion);
const auto Distro = DistroID + "." + DistroVersion;

std::string Distro = {};
if (DistroVersion.empty()) {
Distro = DistroID;
} else {
Distro = DistroID + "." + DistroVersion;
}

Postfix = fmt::format(".{}.{}.{}", DistroID, DistroVersion, Arch);
#else
beammp_infof("BeamMP doesn't provide binaries for this OS, please update manually");
std::exit(1);
#endif

beammp_infof("Looking for BeamMP-Server{}", Postfix);

// check if the release exists for that platform
Expand Down

0 comments on commit eda78f7

Please sign in to comment.