From 6846273b1a37b8b2063576d8ad1cfd4aea755151 Mon Sep 17 00:00:00 2001 From: murkl Date: Sun, 3 Nov 2024 02:14:23 +0100 Subject: [PATCH] add tweaks new line --- d2launcher | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/d2launcher b/d2launcher index b140079..55c75dd 100755 --- a/d2launcher +++ b/d2launcher @@ -404,12 +404,12 @@ show_tweaks_menu() { # Download tweaks db from URL (if not exists) [ ! -f "$SCRIPT_TWEAKS_FILE" ] && ! show_gui_update_tweaks_db && return 1 + # Check syntax if ! [[ "$(sed '/^[[:space:]]*$/d' "${SCRIPT_TWEAKS_FILE}" | head -n 1 | awk '{print $1}')" == "###!"* ]]; then zenity_error "No correct syntax format" exit 1 fi - # 2. # Clear and recreate temporary directory for tweaks rm -rf "${SCRIPT_TEMP_DIR}/tweaks" mkdir -p "${SCRIPT_TEMP_DIR}/tweaks" @@ -420,7 +420,8 @@ show_tweaks_menu() { declare -a name_version_list # Parse tweaks file and save in list (line by line) - while IFS= read -r line; do + # Add empty line at the end + echo >>"$SCRIPT_TWEAKS_FILE" && while IFS= read -r line; do if [[ $line == "###!> name:"* ]]; then # Process previous entry if complete if [[ -n $name && -n $version && -n $content ]]; then