a circuit playground express wizard staff
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.

15 lines
646 B

  1. #! /bin/bash
  2. latest_release=$(curl -s "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Bundle/releases/latest")
  3. download_link=$(echo $latest_release | grep -o "\"browser_download_url\": \"[^\"]*" | cut -d \" -f 4)
  4. tag=$(echo $latest_release | grep -o "\"tag_name\": \"[^\"]*" | cut -d \" -f 4)
  5. current=$(head -n 1 VERSIONS.txt | tr -d '[:space:]')
  6. if [ $? -ne 0 ]
  7. then echo "No VERSIONS.txt please run from lib/"
  8. fi
  9. if [ $current == $tag ]
  10. then echo "Already updated to the latest."; exit 0
  11. fi
  12. save_to=~/Downloads/$(basename $download_link)
  13. echo "Downloading to " $save_to
  14. curl -sL $download_link > $save_to
  15. unzip -o $save_to -d ..