buildfetch: also check for if builds/builds.json exists
One easy way to reset is to just delete builds/builds.json and then
re-run `cosa buildfetch`. In our logic we shouldn't compare the two
files to see if we have local builds if the local builds.json doesn't
exist.
@@ -48,7 +48,8 @@ def main():
builds = None
if fetcher.exists('builds.json'):
if not args.refresh:
- if os.path.isfile(BUILDFILES['sourcedata']):
+ if os.path.isfile(BUILDFILES['sourcedata']) \
+ and os.path.isfile(BUILDFILES['list']):
# If we have local builds, don't overwrite that by default.
if subprocess.call(['cmp', BUILDFILES['sourcedata'], BUILDFILES['list']],
stdout=subprocess.DEVNULL,
