Skip to content

Commit

Permalink
Write manifest if there's nothing to do (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
CommandMC authored Jun 17, 2024
1 parent ea30417 commit 610b0e5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gogdl/dl/managers/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def get(self, return_files=False):

if not len(diff.changed) and not len(diff.deleted) and not len(diff.new):
self.logger.info("Nothing to do")
self._write_manifest(installed)
return

secure_link = dl_utils.get_dependency_link(self.api) # This should never expire
Expand All @@ -116,12 +117,13 @@ def get(self, return_files=False):
if cancelled:
return

repository = self.repository
repository['HGLInstalled'] = list(installed)
self._write_manifest(installed)

json_repository = json.dumps(repository)
def _write_manifest(self, installed: set):
repository = self.repository
repository['HGLInstalled'] = list(installed)
with open(self.installed_manifest, 'w') as f:
f.write(json_repository)
json.dump(repository, f)


class DependenciesDiff(BaseDiff):
Expand Down

0 comments on commit 610b0e5

Please sign in to comment.