diff --git a/functions/checks.sh b/functions/checks.sh index c8e91a2a..e5dc89af 100644 --- a/functions/checks.sh +++ b/functions/checks.sh @@ -171,5 +171,12 @@ elif [[ "$new_version_major_rev" -eq "$current_version_major_rev" ]]; then fi fi +# Perform post_update commands for current version if it is a cooker +if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build, always perform post_update commands for current version + if [[ "$(echo $hard_version | cut -d'-' -f2)" == "$new_version" ]]; then + is_newer_version="true" + fi +fi + echo "$is_newer_version" } diff --git a/retrodeck.sh b/retrodeck.sh index 834ee224..cab440d7 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -102,8 +102,8 @@ done log d "Update triggered" # if lockfile exists if [ -f "$lockfile" ]; then - log d "Lockfile found but the version doesn't match with the config file" if [ "$hard_version" != "$version" ]; then + log d "Lockfile found but the version doesn't match with the config file" log i "Config file's version is $version but the actual version is $hard_version" if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build log d "Newly-installed version is a \"cooker\" build" @@ -130,6 +130,7 @@ if [ -f "$lockfile" ]; then log w "Removing RetroDECK data and starting fresh" rm -rf /var rm -rf "$HOME/retrodeck" + rm -rf "$rdhome" source /app/libexec/global.sh finit fi