Skip to content

Commit

Permalink
clone dojo if directory is not found (e.g., database restores)
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed Nov 18, 2024
1 parent 8fec2a8 commit efc9593
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dojo_plugin/utils/dojo.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,13 @@ def dojo_git_command(dojo, *args):


def dojo_update(dojo):
dojo_git_command(dojo, "fetch", "--depth=1", "origin")
dojo_git_command(dojo, "reset", "--hard", "origin")
dojo_git_command(dojo, "submodule", "update", "--init", "--recursive")
if dojo.path.exists():
dojo_git_command(dojo, "fetch", "--depth=1", "origin")
dojo_git_command(dojo, "reset", "--hard", "origin")
dojo_git_command(dojo, "submodule", "update", "--init", "--recursive")
else:
tmpdir = dojo_clone(dojo.repository, dojo.private_key)
os.rename(tmpdir.name, str(dojo.path))
return dojo_from_dir(dojo.path, dojo=dojo)


Expand Down

0 comments on commit efc9593

Please sign in to comment.