You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
677 B

  1. #/bins/sh
  2. set -e
  3. version="$1"
  4. if [ -z "$version" ]; then
  5. echo "Usage: $0 version"
  6. exit 1
  7. fi
  8. cd "$(dirname $(readlink -f $0))"
  9. echo -n "$version" > latest_version
  10. echo -e "RewriteEngine On" > downloads/.htaccess
  11. echo -e "RewriteRule ^$ https://github.com/ytdl-org/youtube-dl/releases" >> downloads/.htaccess
  12. echo -e "RewriteRule ^(\d{4}\.\d{2}\.\d{2}(?:\.\d+)?/?)$ https://github.com/ytdl-org/youtube-dl/releases/tag/\$1" >> downloads/.htaccess
  13. echo -e "RewriteRule ^(\d{4}\.\d{2}\.\d{2}(?:\.\d+)?/.+)$ https://github.com/ytdl-org/youtube-dl/releases/download/\$1" >> downloads/.htaccess
  14. echo -e "RewriteRule latest(.*) /downloads/$1\$1 [L,R=302]" >> downloads/.htaccess