Skip to content

Commit

Permalink
Take (optional) arguments for start/end versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimlawton committed Jul 3, 2015
1 parent 645ac21 commit c87a19b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions get-sublime-versions.sh
@@ -1,15 +1,26 @@
#!/bin/sh
STARTVER=3065
ENDVER=3092
STARTVER=0
ENDVER=9999

if [ "$#" -gt 0 ]; then
STARTVER=$1
if [ "$#" -gt 1 ]; then
ENDVER=$2
fi
fi
URLBASE="http://c758482.r82.cf2.rackcdn.com/"
TARBASE="sublime_text_3_build_"
DEBBASE="sublime-text_build-"
TARSUFFIX="_x64.tar.bz2"
DEBSUFFIX="_amd64.deb"
ver=$STARTVER
while [ $ver -le $ENDVER ]; do
echo "Getting version ${ver}..."
url="${URLBASE}${TARBASE}${ver}${TARSUFFIX}"
wget $url
if [ $? != 0 ]; then
break
fi
url="${URLBASE}${DEBBASE}${ver}${DEBSUFFIX}"
wget $url
ver=`expr $ver + 1`
Expand Down

0 comments on commit c87a19b

Please sign in to comment.