Last active
November 23, 2020 14:14
-
-
Save digitalbricklayer/719fe73f554208b648dd6129364fc84c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Check redirect destinations work on the dev site | |
SITE_URL="http://localhost:1313" | |
# Start the test server | |
docker-compose up -d | |
# Wait for the test server to start up | |
until $(curl --output /dev/null --silent --head --fail $SITE_URL/); do | |
printf '.' | |
sleep 1 | |
done | |
while read -r _ new_url; do | |
curl --output /dev/null --silent --head --fail $SITE_URL$new_url | |
if [ $? -ne 0 ]; then | |
echo "$new_url - $(tput setaf 1)bad$(tput sgr0)" | |
else | |
echo "$new_url - $(tput setaf 10)okay$(tput sgr0)" | |
fi | |
done < src/static/_redirects | |
docker-compose down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment