Skip to content

Instantly share code, notes, and snippets.

@smitelli
Created October 2, 2015 21:23
Show Gist options
  • Save smitelli/56903fc9b80e2f2f041c to your computer and use it in GitHub Desktop.
Save smitelli/56903fc9b80e2f2f041c to your computer and use it in GitHub Desktop.
Downloads AdBlock releases and commits 'em
#!/usr/bin/bash
BASE=/cygdrive/c/Users/ssmitelli/Downloads
cd "$BASE"
wget -r -np -k http://code.getadblock.com/releases/
# Manually delete crap here
cd ~/abfc/
for fn in `ls $BASE/code.getadblock.com/releases/*.zip | sort -V`; do
git ls-files | xargs rm
unzip "$fn" -d /tmp
cp -rTv /tmp/adblock .
rm -rf /tmp/adblock
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
export GIT_AUTHOR_DATE=$(date -d "`stat -c '%y' $fn`" --utc +%FT%TZ)
export GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE
git add .
bn=$(basename "$fn")
git commit -am "Replaying release file $bn"
tn=$(echo -n "$bn" | sed 's/AdBlock-//;s/\.zip//')
git tag -a "$tn" -m "Public release file $bn"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment