Skip to content

Instantly share code, notes, and snippets.

@shovon
Created July 17, 2014 03:15
Show Gist options
  • Save shovon/41d23cbdfefc0362c78e to your computer and use it in GitHub Desktop.
Save shovon/41d23cbdfefc0362c78e to your computer and use it in GitHub Desktop.
A utility to delete all repository folders from dependencies. Useful when you want to check dependencies in with the source code. All credit goes to http://blog.robertmeta.com/post/76233441527/stop-overcomplicated-go-lang-build-deps
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export GOPATH=$DIR
echo "Clean up source history downloaded"
find . -type d | grep \.hg$ | xargs rm -rf
find . -type d | grep \.bzr$ | xargs rm -rf
find . -type d | grep -v ^\./\.git$ | grep \.git$ | xargs rm -rf
# might need to add svn if we ever use SVN repos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment