File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import json
8
8
import os
9
+ import requests
9
10
import subprocess
10
11
import sys
11
12
import sh
@@ -96,7 +97,19 @@ def get_current_info():
96
97
response = response .json ()
97
98
98
99
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
+
100
113
current_info = {}
101
114
for info in current_list :
102
115
current_info [info ["id" ]] = info
You can’t perform that action at this time.
0 commit comments