From ed248269692bceaea81cb5b1bc0776317f6eaf57 Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Sat, 16 Sep 2023 18:01:34 +0200 Subject: [PATCH] assemble: better comment detection, Fix #956 Signed-off-by: Luca Di Maio --- distrobox-assemble | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/distrobox-assemble b/distrobox-assemble index 7e34acb3b3..67316fbe1c 100755 --- a/distrobox-assemble +++ b/distrobox-assemble @@ -408,8 +408,14 @@ parse_file() ( # blank line, skip continue fi + # Remove comments and trailing spaces - line="$(echo "${line}" | sed 's/#.*//g' | sed 's/\s*$//g')" + line="$(echo "${line}" | + sed 's/\t/ /g' | + sed 's/^#.*//g' | + sed 's/].*#.*//g' | + sed 's/ #.*//g' | + sed 's/\s*$//g')" # Detect start of new section if [ "$(echo "${line}" | cut -c 1)" = '[' ]; then