Skip to content

Instantly share code, notes, and snippets.

@Rovanion
Last active March 7, 2017 10:40
Show Gist options
  • Save Rovanion/12742281888626c4ad5f063b68bc0258 to your computer and use it in GitHub Desktop.
Save Rovanion/12742281888626c4ad5f063b68bc0258 to your computer and use it in GitHub Desktop.
Fetches all projects from clojure-toolbox.com and runs lein-master on them, define lein-master in your PATH for this to work.
#!/usr/bin/env bash
lst="$(curl -s http://www.clojure-toolbox.com/ \
| sed -n 's/.*href="\([^"]*\).*/\1/p' \
| grep -F 'https://github.com' | sort | uniq)"
dir="$PWD"
mkdir -p toolbox-projects
cd toolbox-projects
for p in $lst; do
echo "checking out $p"
pname="$(echo $p | sed 's%.*/%%')"
gitRepo="$(echo $p | sed 's%^https://github\.com/%git@github\.com:%')"
if [ ! -d "$pname" ]; then
git clone --depth=1 "$gitRepo" "$pname"
fi
done
rm -f "$dir/output.txt"
for d in */; do
cd "$d"
if [ -f project.clj ]; then
echo "testing $d" 2>&1 | tee -a "$dir/output.txt"
lein-master deps 2>&1 | tee -a "$dir/output.txt"
fi
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment