Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (19 sloc) 817 Bytes
# This script downloads the list from and uses it to regenerate
# the ".tld" feature's regular expression.
# See:
# To date, this script is only expected to be comatible with GNU toolchains.
set -e
# Create the mega list of TLDs as a regular expression.
TLDS=`curl -s "$URL" | \
egrep -v '^$|^//|^!' | \
sort | \
sed -e 's/\s.*//' -e 's/\./\\./' -e 's/^\*/[^.]+/' | \
tr '\n' '|' | \
sed -e 's/|$//'`
# Remove the last line, where this data lives.
sed -i -e '$d' modules/third-party/convert2RegExp.js
# Replace it with the new data.
echo "var tldStr = \"\\.(?:$TLDS)\";" >> modules/third-party/convert2RegExp.js
Something went wrong with that request. Please try again.