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.
 
 
 

16 lines
662 B

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