Skip to content

Commit

Permalink
Update updater.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Avinash Reddy authored Dec 16, 2019
1 parent 85b6a76 commit a4c9934
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions userbot/modules/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ async def upstream(ups):
f'`[WARNING] Directory {error} does not seems to be a git repository.\
\nTry force-updating the userbot using .update now.`')
return
if os.path.exists(f"{basepath}\.git")
repo = Repo.init(basedir)
repo.git.fetch(UPSTREAM_REPO_URL)
repo_worker.git.reset('--hard')
repo_worker.git.clean('-fdx')
else:
rmtree(basedir, ignore_errors=True)
makedirs(basedir)
Repo.clone_from(UPSTREAM_REPO_URL, basedir)
if os.path.exists(f"{basepath}\.git"):
repo = Repo.init(basedir)
repo.git.fetch(UPSTREAM_REPO_URL)
repo_worker.git.reset('--hard')
repo_worker.git.clean('-fdx')
else:
rmtree(basedir, ignore_errors=True)
makedirs(basedir)
Repo.clone_from(UPSTREAM_REPO_URL, basedir)
reqs_upgrade = await update_requirements()
await ups.edit(
'`Updated succesfully, check the commit history for changelog.\n'
Expand Down

0 comments on commit a4c9934

Please sign in to comment.