From 3ed4dee61eb6638936272c8d4fd75d305a37f39a Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 6 Oct 2022 23:47:09 +0200 Subject: [PATCH] Fixed version recognition --- global.sh | 5 +++-- retrodeck.sh | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/global.sh b/global.sh index 7b957a46..e1fe4d99 100755 --- a/global.sh +++ b/global.sh @@ -70,10 +70,11 @@ then echo "RetroDECK config file not found in $rd_conf" echo "Initializing" - touch $rd_conf # Initializing the variables - version="$hard_version" # if we are here means that the we are in a new installation, so the version is valorized with the hardcoded one + if [ -z $version]; then + version="$hard_version" # if we are here means that the we are in a new installation, so the version is valorized with the hardcoded one + fi rdhome="$HOME/retrodeck" # the retrodeck home, aka ~/retrodeck roms_folder="$rdhome/roms" # the default roms folder path saves_folder="$rdhome/saves" # the default saves folder path diff --git a/retrodeck.sh b/retrodeck.sh index 5ab2d8f9..4091758c 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -1,5 +1,15 @@ #!/bin/bash +# workaround to fix a bug when updating to 0.5.0b where the post update is not triggered +# basically from 0.5 it's not reading the version from the lockfile so it doesn't know from which version it came from and the new rule of global.sh is that if version is unknown it's like a first boot +# remove it in the future +lockfile="/var/config/retrodeck/.lock" +if [[ $(cat $lockfile) == *"0.4."* ]] || [[ $(cat $lockfile) == *"0.3."* ]] || [[ $(cat $lockfile) == *"0.2."* ]] || [[ $(cat $lockfile) == *"0.1."* ]] +then + echo "Running version workaround" + version=$(cat $lockfile) +fi + source /app/bin/global.sh # We moved the lockfile in /var/config/retrodeck in order to solve issue #53 - Remove in a few versions