File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77import json
88import os
9+ import requests
910import subprocess
1011import sys
1112import sh
@@ -96,7 +97,19 @@ def get_current_info():
9697 response = response .json ()
9798
9899 git_info = commit_sha , response ["sha" ]
99- current_list = json .loads (base64 .b64decode (response ["content" ]).decode ("utf-8" ))
100+
101+ if response ["content" ] != "" :
102+ # if the file is there
103+ current_list = json .loads (base64 .b64decode (response ["content" ]).decode ("utf-8" ))
104+ else :
105+ # if too big, the file is not included
106+ download_url = response ["download_url" ]
107+ response = requests .get (download_url )
108+ if not response .ok :
109+ print (response .text )
110+ raise RuntimeError ("cannot get previous files.json" )
111+ current_list = response .json ()
112+
100113 current_info = {}
101114 for info in current_list :
102115 current_info [info ["id" ]] = info
You can’t perform that action at this time.
0 commit comments