From 57f4fcc0ec2e8d4ef71f53728e0b76d07f5d28eb Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 24 Oct 2024 22:45:17 -0400 Subject: [PATCH] handle slashes a bit --- crediting/credit.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crediting/credit.sh b/crediting/credit.sh index 28cd0e3..538ffba 100755 --- a/crediting/credit.sh +++ b/crediting/credit.sh @@ -19,37 +19,37 @@ while read p || [[ -n $p ]]; do if [[ "${FIELDS[1]}" =~ ^"[yt]/" ]] then echo "tubelike!" - FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 6- ) + FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 6- | sed 's/\//\\\//g') echo "${FIELDS[1]}" sed -i 's/\[platform img\]//' "$SCRIPT_DIR/credit2.html" elif [[ "${FIELDS[1]}" =~ ^"[vimeo]/" ]] then echo "vimeous!" - FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 9- ) + FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 9- | sed 's/\//\\\//g') sed -i 's/\[platform img\]//' "$SCRIPT_DIR/credit2.html" elif [[ "${FIELDS[1]}" =~ ^"[fandom]/" ]] then echo "fandom wiki!" - FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 10- ) + FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 10- | sed 's/\//\\\//g') sed -i 's/\[platform img\]//' "$SCRIPT_DIR/credit2.html" elif [[ "${FIELDS[1]}" =~ ^"[github]/" ]] then echo "github!" - FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 10- ) + FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 10- | sed 's/\//\\\//g') sed -i 's/\[platform img\]//' "$SCRIPT_DIR/credit2.html" elif [[ "${FIELDS[1]}" =~ ^"[mastodon]/" ]] then echo "mastodon!" - FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 12- ) + FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 12- | sed 's/\//\\\//g') sed -i 's/\[platform img\]//' "$SCRIPT_DIR/credit2.html" elif [[ "${FIELDS[1]}" =~ ^"[twitch]/" ]] then echo "twitch!" - FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 10- ) + FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 10- | sed 's/\//\\\//g') sed -i 's/\[platform img\]//' "$SCRIPT_DIR/credit2.html" else echo "who?!" - FIELDS[1]=$( echo "${FIELDS[1]}" ) + FIELDS[1]=$( echo "${FIELDS[1]}" | sed 's/\//\\\//g') sed -i 's/\[platform img\]//' "$SCRIPT_DIR/credit2.html" fi echo "setting author to ${FIELDS[1]}!"