From 5a70bc1159d192425d0aa75efa7a2111fa6941ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Mon, 29 Jan 2024 23:34:26 +0100 Subject: [PATCH] Rewrite _cleanup --- qsgen2 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/qsgen2 b/qsgen2 index 59ce0fe..8b62e73 100755 --- a/qsgen2 +++ b/qsgen2 @@ -635,13 +635,14 @@ function _youtube() { function _cleanup() { # This removes tags used in the templates that may be left over for some reason - local debug=false + local debug=true - if (${debug}) echo "${red}_cleanup: Cleaning up links in: ${www_root}/${1%.*}.html${end}" - sed -i -- "s|¤||g" ${www_root}/${1%.*}.html - sed -i -- "s|#showimg\ ||g" ${www_root}/${1%.*}.html - sed -i -- "s|#ytvideo\ ||g" ${www_root}/${1%.*}.html - sed -i -- "s|#link\ ||g" ${www_root}/${1%.*}.html + if (${debug}) echo "${red}_cleanup: Cleaning up links in: ${1}${end}" + echo ${1} | sed \ + -e "s|¤||g" \ + -e "s|#showimg\ ||g" \ + -e "s|#ytvideo\ ||g" \ + -e "s|#link\ ||g" }