Skip to content

Instantly share code, notes, and snippets.

@invisiblek
Created December 28, 2016 21:16
Show Gist options
  • Save invisiblek/560b2917c3ecd1eb2f33670f4e450db9 to your computer and use it in GitHub Desktop.
Save invisiblek/560b2917c3ecd1eb2f33670f4e450db9 to your computer and use it in GitHub Desktop.
#!/bin/bash
while [ $# -gt 0 ]; do
case $1 in
-a|--all|all) all=true;;
esac
shift
done
killit() {
repo sync -j16 -q -d .
git for-each-ref --format '%(refname:short)' refs/heads | grep -v master | xargs git branch -D
}
if [ "$all" == "true" ]; then
while read line; do
if [[ ${line:0:1} == '#' ]] || [ "$line" == "" ]; then
continue
fi
cd /home/dp/cm/13.0/kernel/$line
killit
done < ~/build_targets/my_kernels
else
killit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment