sourcegraph/dev/check/docsite_redirects.sh
Stefan Hengl c61b0f1a7b
all: /bin/bash -> /usr/bin/env bash (#23673)
I ran into issues setting up Sourcegraph on NixOS, because NixOS, like
some other distros, doesn't have a /bin/bash. We already use /usr/bin/env
in many of our scripts, so this improves consistency, too.
2021-08-06 12:02:43 +02:00

13 lines
362 B
Bash
Executable File

#!/usr/bin/env bash
set -eu -o pipefail
REDIRECTS_FILE=../../doc/_resources/assets/redirects
# Prints out the HTTP status code for all of the absolute urls in the redirects file.
dest_urls=$(awk '{print $2;}' <"$REDIRECTS_FILE" | sort | uniq | grep '^https:')
for URL in $dest_urls; do
echo -n "$URL "
curl -s -o /dev/null -w "%{http_code}\n" "$URL"
done