From eda78f7e57b4c90acb08a0ccff7da9db604053a2 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Mon, 8 Jan 2024 11:50:26 +0100 Subject: [PATCH] leave out version if not exists --- src/Update.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Update.cpp b/src/Update.cpp index b9f95d9..b12b602 100644 --- a/src/Update.cpp +++ b/src/Update.cpp @@ -1,13 +1,13 @@ #include "Update.h" #include "Common.h" #include +#include #include #include #include #include #include #include -#include #if defined(__linux) #include @@ -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