dev-download-and-check-release.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # This script downloads the published versions of exa from GitHub and my site,
  2. # checks that the checksums match, and makes sure the files at least unzip and
  3. # execute okay.
  4. #
  5. # The argument should be of the form “0.8.0”, no ‘v’. That version was the
  6. # first one to offer checksums, so it’s the minimum version that can be tested.
  7. set +x
  8. trap 'exit' ERR
  9. exa_version=$1
  10. if [[ -z "$exa_version" ]]; then
  11. echo "Please specify a version, such as '$0 0.8.0'"
  12. exit 1
  13. fi
  14. # Delete anything that already exists
  15. rm -rfv "/tmp/${exa_version}-downloads"
  16. # Create a temporary directory and download exa into it
  17. mkdir "/tmp/${exa_version}-downloads"
  18. cd "/tmp/${exa_version}-downloads"
  19. echo -e "\n\033[4mDownloading stuff...\033[0m"
  20. wget --quiet --show-progress "https://github.com/ogham/exa/releases/download/v${exa_version}/exa-macos-x86_64-${exa_version}.zip"
  21. wget --quiet --show-progress "https://github.com/ogham/exa/releases/download/v${exa_version}/exa-linux-x86_64-${exa_version}.zip"
  22. wget --quiet --show-progress "https://github.com/ogham/exa/releases/download/v${exa_version}/MD5SUMS"
  23. wget --quiet --show-progress "https://github.com/ogham/exa/releases/download/v${exa_version}/SHA1SUMS"
  24. # Unzip the zips and check the sums
  25. echo -e "\n\033[4mExtracting that stuff...\033[0m"
  26. unzip "exa-macos-x86_64-${exa_version}.zip"
  27. unzip "exa-linux-x86_64-${exa_version}.zip"
  28. echo -e "\n\033[4mValidating MD5 checksums...\033[0m"
  29. md5sum -c MD5SUMS
  30. echo -e "\n\033[4mValidating SHA1 checksums...\033[0m"
  31. sha1sum -c SHA1SUMS
  32. # Finally, give the Linux version a go
  33. echo -e "\n\033[4mChecking it actually runs...\033[0m"
  34. ./"exa-linux-x86_64" --version
  35. ./"exa-linux-x86_64" --long
  36. echo -e "\n\033[1;32mAll's lookin' good!\033[0m"