Skip to content

Commit

Permalink
Fail build if artefact does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
krichardsson committed Sep 8, 2016
1 parent 7c192de commit 030ba77
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools/build/package
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ __author__ = 'kristoffer'
download_dir = "/download"


class UrlOpenerError(urllib.FancyURLopener):
def http_error_default(self, req, fp, code, msg, hdrs):
if code > 400:
print("Failed to download, HTTP response code {} {}. Aborting".
format(code, msg))
exit(1)


def _read_manifest(path):
with open(path + "/src/manifest.json", 'r') as file:
return json.load(file)
Expand All @@ -23,7 +31,7 @@ def _download(path, manifest):
dest = path + download_dir + "/" + file_name

print("Downloading " + url)
urllib.urlretrieve(url, dest)
UrlOpenerError().retrieve(url, dest)


def _create_zip(path, manifest):
Expand Down

0 comments on commit 030ba77

Please sign in to comment.