From daa0fe3a91329bede70f8e3722ffb09594d4dd5a Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Thu, 16 Feb 2023 22:24:42 +0100 Subject: [PATCH] Added a program release number. --- es-app/src/EmulationStation.h | 1 + es-app/src/main.cpp | 8 ++++---- tools/update_version_string.sh | 9 +++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/es-app/src/EmulationStation.h b/es-app/src/EmulationStation.h index 49058fe63..8ef5f6745 100644 --- a/es-app/src/EmulationStation.h +++ b/es-app/src/EmulationStation.h @@ -14,6 +14,7 @@ #define PROGRAM_VERSION_MAJOR 2 #define PROGRAM_VERSION_MINOR 0 #define PROGRAM_VERSION_MAINTENANCE 0 +#define PROGRAM_RELEASE_NUMBER 28 // clang-format on #define PROGRAM_VERSION_STRING "2.0.0-beta" diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index f24b646d5..8837fb7a6 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -397,7 +397,8 @@ bool parseArgs(int argc, char* argv[]) Log::setReportingLevel(LogDebug); } else if (strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-v") == 0) { - std::cout << "EmulationStation Desktop Edition v" << PROGRAM_VERSION_STRING << "\n"; + std::cout << "EmulationStation Desktop Edition v" << PROGRAM_VERSION_STRING << " (r" + << PROGRAM_RELEASE_NUMBER << ")\n"; return false; } else if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) { @@ -582,9 +583,8 @@ int main(int argc, char* argv[]) // Start the logger. Log::init(); Log::open(); - LOG(LogInfo) << "EmulationStation Desktop Edition v" << PROGRAM_VERSION_STRING << ", built " - << PROGRAM_BUILT_STRING; - + LOG(LogInfo) << "EmulationStation Desktop Edition v" << PROGRAM_VERSION_STRING << " (r" + << PROGRAM_RELEASE_NUMBER << "), built " << PROGRAM_BUILT_STRING; if (portableMode) { LOG(LogInfo) << "Running in portable mode"; } diff --git a/tools/update_version_string.sh b/tools/update_version_string.sh index 815779efb..7d490d3c3 100755 --- a/tools/update_version_string.sh +++ b/tools/update_version_string.sh @@ -84,6 +84,15 @@ NEWSTRING="#define RESOURCE_VERSION_STRING \"${1},${2},${3}" cat $MODIFYFILE | sed s/"${MODIFYSTRING}"/"${NEWSTRING}"/ > $TEMPFILE mv $TEMPFILE $MODIFYFILE +MODIFYSTRING=$(grep "PROGRAM_RELEASE_NUMBER" $MODIFYFILE) +OLDRELEASE=$(grep "PROGRAM_RELEASE_NUMBER" $MODIFYFILE | sed "s/[^0-9]//g") +((NEWRELEASE=OLDRELEASE+1)) +echo "Increased release number from ${OLDRELEASE} to ${NEWRELEASE}" +NEWSTRING=$(grep "PROGRAM_RELEASE_NUMBER" $MODIFYFILE | sed "s/$OLDRELEASE/$NEWRELEASE/") + +cat $MODIFYFILE | sed s/"${MODIFYSTRING}"/"${NEWSTRING}"/ > $TEMPFILE +mv $TEMPFILE $MODIFYFILE + ##### EmulationStation-DE_Info.plist MODIFYFILE=../es-app/assets/EmulationStation-DE_Info.plist