diff --git a/match/gifs.yml b/match/gifs.yml index 0cde71a..01c3d74 100644 --- a/match/gifs.yml +++ b/match/gifs.yml @@ -35,8 +35,6 @@ matches: replace: "https://c.tenor.com/hPsNhgYicFMAAAAC/tenor.gif" - trigger: "gif.ignore" replace: "https://c.tenor.com/AlUkiGkR2j8AAAAC/tenor.gif" - - trigger: "gif.smoke" - replace: "https://media.tenor.com/FJ8kmkejJx4AAAPo/anime-cool.gif" - trigger: "gif.shh" replace: "https://c.tenor.com/P32p3dPsEgkAAAAC/tenor.gif" - trigger: "gif.giggle" @@ -44,7 +42,7 @@ matches: - trigger: "gif.wave" replace: "https://c.tenor.com/FvthnLepGgAAAAAC/tenor.gif" - trigger: "gif.salute" - replace: "https://c.tenor.com/DBT7E154-pgAAAAC/tenor.gif" + replace: "https://c.tenor.com/NahzVADyncsAAAAd/tenor.gif" - trigger: "gif.thank" replace: "https://c.tenor.com/xITmP6QW3woAAAAC/tenor.gif" - trigger: "gif.peek" @@ -56,7 +54,7 @@ matches: - trigger: "gif.objection" replace: "https://c.tenor.com/kHS2x_pJVrwAAAAC/tenor.gif" - trigger: "gif.dance" - replace: "https://media.tenor.com/mGmDiWX42y0AAAAi/anime-dance-vyn-anime-dance.gif" + replace: "https://c.tenor.com/g9xOFVXmNx0AAAAd/tenor.gif" - trigger: "gif.dancy" replace: "https://c.tenor.com/m21RwoBHceEAAAAd/tenor.gif" - trigger: "gif.cheer" @@ -78,4 +76,10 @@ matches: - trigger: "gif.pray" replace: "https://c.tenor.com/d8vq5hthkAoAAAAC/tenor.gif" - trigger: "gif.psychic" - replace: "https://c.tenor.com/ETmw31CyCmQAAAAd/tenor.gif" \ No newline at end of file + replace: "https://c.tenor.com/ETmw31CyCmQAAAAd/tenor.gif" + - trigger: "gif.wiggle" + replace: "https://c.tenor.com/6bGvizlex6oAAAAd/tenor.gif" + - trigger: "gif.lurk" + replace: "https://c.tenor.com/Bh5FPIsK2xEAAAAd/tenor.gif" + - trigger: "gif.stare" + replace: "https://c.tenor.com/VC3EDnfJmKEAAAAd/tenor.gif" \ No newline at end of file diff --git a/test.sh b/test.sh index 688549a..3d644bd 100755 --- a/test.sh +++ b/test.sh @@ -49,7 +49,44 @@ else echo "Trigger \"$dupe\" found in:" grep -l "trigger: \"$dupe\"" "$MATCH_DIR"/*.y*ml done + exit 1 fi # Clean up rm "$ALL_TRIGGERS" + +### Now we test that all gifs.yml replace values match "c.tenor.com". + +# Temporary file to store all replace values +REPLACE_VALUES=$(mktemp) + +# Read gifs.yml file and extract replace values +echo "Scanning gifs.yml for replace values..." +if [ -f "$MATCH_DIR/gifs.yml" ]; then + # We match lines like: ` replace: "https://c.tenor.com/some-value/tenor.gif"` + grep -E '^\s*replace:' "$MATCH_DIR/gifs.yml" | sed 's/.*replace:\s*"\([^"]*\)".*/\1/' >> "$REPLACE_VALUES" +else + echo "Error: gifs.yml file not found in $MATCH_DIR directory!" + rm "$REPLACE_VALUES" + exit 1 +fi + +# Check if we found any replace values +if [ ! -s "$REPLACE_VALUES" ]; then + echo "No replace values found in gifs.yml. Check file format." + rm "$REPLACE_VALUES" + exit 1 +fi + +# Check if all replace values start with "https://c.tenor.com/" +echo -e "\nChecking replace values in gifs.yml..." +INVALID_REPLACE=$(grep -v '^https://c\.tenor\.com/' "$REPLACE_VALUES") +if [ -z "$INVALID_REPLACE" ]; then + echo "Success: All replace values in gifs.yml are valid!" +else + echo "Error: Invalid replace values found in gifs.yml:" + echo "$INVALID_REPLACE" +fi + +# This must always be the final line, so that CI can detect success. If you want to exit with a failure, do so at the conditional point. +exit 0 \ No newline at end of file