From 72efc37248d214bcf38c93864babd8c1734ebafc Mon Sep 17 00:00:00 2001 From: icenine451 Date: Tue, 25 Mar 2025 09:39:06 -0400 Subject: [PATCH] Move sanitize() function to other_functions.sh --- functions/other_functions.sh | 6 ++++++ functions/steam_sync.sh | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/functions/other_functions.sh b/functions/other_functions.sh index b72ee124..53399191 100644 --- a/functions/other_functions.sh +++ b/functions/other_functions.sh @@ -1401,3 +1401,9 @@ repair_paths() { configurator_generic_dialog "RetroDECK Path Repair" "All RetroDECK folders were found at their expected locations." fi } + +# Function to sanitize strings for filenames +sanitize() { + # Replace sequences of underscores with a single space + echo "$1" | sed -e 's/_\{2,\}/ /g' -e 's/_/ /g' -e 's/:/ -/g' -e 's/&/and/g' -e 's%/%and%g' -e 's/ / /g' +} diff --git a/functions/steam_sync.sh b/functions/steam_sync.sh index 64a6077f..f94358c9 100644 --- a/functions/steam_sync.sh +++ b/functions/steam_sync.sh @@ -1,10 +1,6 @@ #!/bin/bash -# Function to sanitize strings for filenames -sanitize() { - # Replace sequences of underscores with a single space - echo "$1" | sed -e 's/_\{2,\}/ /g' -e 's/_/ /g' -e 's/:/ -/g' -e 's/&/and/g' -e 's%/%and%g' -e 's/ / /g' -} + add_to_steam() {