Skip to content

Commit

Permalink
minor bug fix on pulling docker image, bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
rongxin-liu committed Jan 19, 2022
1 parent 11feb4e commit 37372a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions cli50/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,20 @@ def main():
# Check Docker Hub for newer image
if not args["fast"]:

# Determine platform architecture
arch = json.loads(subprocess.check_output([
"docker", "inspect", f"{IMAGE}:{args['tag']}"
], stderr=subprocess.DEVNULL).decode("utf-8"))[0]["Architecture"]

# Remote digest
try:
digest = requests.get(f"https://registry.hub.docker.com/v2/repositories/{IMAGE}/tags/{args['tag']}").json()["images"][0]["digest"]
except requests.RequestException:
digest = None

# Local digest
try:

# Determine platform architecture
arch = json.loads(subprocess.check_output([
"docker", "inspect", f"{IMAGE}:{args['tag']}"
], stderr=subprocess.DEVNULL).decode("utf-8"))[0]["Architecture"]

Manifest = json.loads(subprocess.check_output([
"docker", "manifest", "inspect", f"{IMAGE}:{args['tag']}"
], stderr=subprocess.DEVNULL).decode("utf-8"))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"console_scripts": ["cli50=cli50.__main__:main"]
},
url="https://github.com/cs50/cli50",
version="7.1.5",
version="7.1.6",
include_package_data=True
)

0 comments on commit 37372a6

Please sign in to comment.