So, I'd like to create a shell script that automates the process of downloading a package, unzipping it, cd'ing into it, configuring it, and compiling it from source.
I have started with a simple script below:
curl https://api.github.com/repos/$PROJ/$PROJ/tags -o $PROJ.json
cat $PROJ.json | grep -Po '(?<="name": ")[^"]*'
At https://api.github.com/repos/ruby/ruby/tags I dont'see the word ruby in any tags name.
The tags are sorted by name in reverse order (the same as a
You can download and extract the latest tag ruby tarball by:
LAST_URL=`cat ruby.json | grep -Po '(?<="tarball_url": ")[^"]* | egrep -v [a-z]$ | head -1' wget $LAST_URL && tar -xvzf `basename $LAST_URL`
egrep -v [a-z]$filters out non ruby packages, not finishing in a number (es. yarv_migration_base)
head -1takes the first tag (in the form vX_X_X) in a reverse order, the most recent