Skip to content

Commit

Permalink
Ensure that cloning GIT repo always works
Browse files Browse the repository at this point in the history
  • Loading branch information
TorecLuik committed May 1, 2024
1 parent 5577904 commit 31f561b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions biomero/slurm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,10 @@ def setup_job_scripts(self):
"REPOSRC": self.slurm_script_repo,
"LOCALREPO": self.slurm_script_path
}
cmd = 'git clone "$REPOSRC" "$LOCALREPO" 2> /dev/null || git -C "$LOCALREPO" pull'
r = self.run_commands([cmd], env)
# Cleanup the existing folder first
cleanup_first = 'rm -rf "$LOCALREPO"'
cmd = 'git clone "$REPOSRC" "$LOCALREPO" 2> /dev/null'
r = self.run_commands([cleanup_first, cmd], env)
if not r.ok:
raise SSHException(r)
elif self.slurm_script_path:
Expand Down

0 comments on commit 31f561b

Please sign in to comment.