From 364c6941f53a7289f975ca69cbbd7dacaf9a27fe Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: May 07 2019 04:13:39 +0000 Subject: Don't swallow the output of go get when it fails. --- diff --git a/go2rpm/__main__.py b/go2rpm/__main__.py index fe0754d..3e62a74 100644 --- a/go2rpm/__main__.py +++ b/go2rpm/__main__.py @@ -257,10 +257,17 @@ def download(goipath): stderr=subprocess.STDOUT) except subprocess.CalledProcessError as err: if b'no Go files in' in err.stdout: - subprocess.check_output(['go', 'get', '-d', goipath + '/...'], - stderr=subprocess.STDOUT) + try: + subprocess.check_output(['go', 'get', '-d', goipath + '/...'], + stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as err: + print(f"ERROR: Unable to 'go get {goipath}':") + print(err.stdout.decode()) + sys.exit(1) else: - raise + print(f"ERROR: Unable to 'go get {goipath}':") + print(err.stdout.decode()) + sys.exit(1) repo = git.Repo(os.path.join(GIT_CACHEDIR, *get_repo_host(goipath))) repo.git.checkout("master") repo.head.reference = repo.heads.master