From d1c6ad528446be91f425ba2779bac5165b886dad Mon Sep 17 00:00:00 2001
From: icenine451 <benjamin.r.shelton@protonmail.com>
Date: Thu, 9 Mar 2023 11:08:57 -0500
Subject: [PATCH] Fix version variable missing value after updating
 retrodeck.cfg

---
 functions.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/functions.sh b/functions.sh
index 8430d21d..772c6b6c 100644
--- a/functions.sh
+++ b/functions.sh
@@ -564,8 +564,9 @@ update_rd_conf() {
   mv -f $rd_conf $rd_conf_backup # Backup config file before update
 
   generate_single_patch $rd_defaults $rd_conf_backup $rd_update_patch retrodeck
-  sed -i '/change^^version/d' $rd_update_patch # Remove version line from temporary patch file
+  sed -i '/change^^version/d' $rd_update_patch # Remove version line from temporary patch file, so old value isn't kept
   deploy_single_patch $rd_defaults $rd_update_patch $rd_conf
+  set_setting_value $rd_conf "version" "$hard_version" retrodeck # Set version of currently running RetroDECK to updated retrodeck.cfg
   rm -f $rd_update_patch # Cleanup temporary patch file
   source $rd_conf # Load new config file variables
 }