Created
July 6, 2015 14:16
-
-
Save jee1mr/55bd38e5163641f16889 to your computer and use it in GitHub Desktop.
Auto script for getting Go dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import re | |
import commands | |
build_error = commands.getoutput("go build") | |
print "go build errors:" | |
print build_error | |
sources = re.findall(r"cannot find package \"[a-zA-Z.\/]*\"",build_error) | |
print "Running go get:" | |
for source in sources: | |
link = source.strip("cannot find package") | |
print("Getting " + link) | |
commands.getoutput("go get "+link) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment