From 99daaa888f6e52bcc196d49e2715c44a4ca2b1f9 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 8 Aug 2024 14:34:57 +0900 Subject: [PATCH] POST_UPDATE: solving a bug where ES-DE path was placed twice in some occasions --- functions/post_update.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/functions/post_update.sh b/functions/post_update.sh index 67545017..5466cd04 100644 --- a/functions/post_update.sh +++ b/functions/post_update.sh @@ -406,7 +406,13 @@ if [[ $(check_version_is_older_than "0.8.4b") == "true" ]]; then log d "Injecting the new retrodeck/ES-DE subdir into the retrodeck.cfg" - sed -i -e '/media_folder=/s|retrodeck/|retrodeck/ES-DE/|g' -e '/themes_folder=/s|retrodeck/|retrodeck/ES-DE/|g' "$rd_conf" && log d "Injection successful" + # Check if ES-DE already exists in media_folder or themes_folder + if grep -E '^(media_folder|themes_folder)=.*ES-DE' "$rd_conf"; then + log d "ES-DE path already exists in media_folder or themes_folder" + else + # Update the paths if ES-DE does not exist + sed -i -e '/media_folder=/s|retrodeck/|retrodeck/ES-DE/|g' -e '/themes_folder=/s|retrodeck/|retrodeck/ES-DE/|g' "$rd_conf" && log d "Injection successful" + fi log d "$(cat "$rd_conf" | grep media_folder)" log d "$(cat "$rd_conf" | grep themes_folder)" conf_read