Thursday, December 22, 2011

download jquery

Once or twice a month I'll find myself working on some random little project with a web UI and so of course I need jquery at which point I wonder if I have the latest version.. hence, a little script to get the latest and greatest:

#!/bin/bash

wget $(\
 wget -qO - http://docs.jquery.com/Downloading_jQuery |\
 sed -rn 's#^.*(http://code.jquery.com/jquery-[[:digit:]]+.[[:digit:]]+.[[:digit:]]+.min.js).*$#\1#p' |\
 head -n 1
 )

todo: check local jquery copy to see if there actually is a new version we need to download

No comments:

Post a Comment