@@ -164,7 +164,6 @@ def updateByManifest(path, dryRun=False):
164
164
for filePath , hash in remoteFiles .items ():
165
165
if hash != localFiles .get (filePath ):
166
166
newPaths .append (filePath )
167
-
168
167
if not dryRun :
169
168
deletedPaths = []
170
169
for filePath in localFiles :
@@ -174,25 +173,30 @@ def updateByManifest(path, dryRun=False):
174
173
if deletedPaths :
175
174
print ("Deleted {} old data file{}." .format (len (deletedPaths ), "s" if len (deletedPaths ) > 1 else "" ))
176
175
176
+ newManifest = None
177
177
if not dryRun :
178
178
if newPaths :
179
179
say (f"Updating { len (newPaths )} file{ 's' if len (newPaths ) > 1 else '' } ..." )
180
180
goodPaths , badPaths = asyncio .run (updateFiles (path , newPaths ))
181
+ newManifest = createFinishedManifest (remoteManifest , goodPaths , badPaths )
181
182
try :
182
183
with open (os .path .join (path , "manifest.txt" ), "w" , encoding = "utf-8" ) as fh :
183
- fh .write (createFinishedManifest ( remoteManifest , goodPaths , badPaths ) )
184
+ fh .write (newManifest )
184
185
except Exception as e :
185
186
warn (f"Couldn't save new manifest file.\n { e } " )
186
187
return False
188
+ if newManifest is None :
189
+ newManifest = createManifest (path , dryRun = True )
190
+
187
191
if not badPaths :
188
192
say ("Done!" )
189
- return True
193
+ return newManifest
190
194
else :
191
195
phrase = f"were { len (badPaths )} errors" if len (badPaths ) > 1 else "was 1 error"
192
196
die (
193
197
f"Done, but there { phrase } (of { len (newPaths )} total) in downloading or saving. Run `bikeshed update` again to retry."
194
198
)
195
- return True
199
+ return newManifest
196
200
197
201
198
202
async def updateFiles (localPrefix , newPaths ):
0 commit comments