Skip to content

Commit

Permalink
fixed update button to add revert b4 pull
Browse files Browse the repository at this point in the history
  • Loading branch information
IBuildRoboats committed Nov 23, 2024
1 parent 1ef9196 commit 53447c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ModUpdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
QHBoxLayout, QMessageBox
import shutil

# Build with pyinstaller --onefile --icon=app.ico ModUpdater.py

class GitCloneThread(QThread):
"""Thread to handle the Git clone operation so it doesn't block the UI."""
Expand Down Expand Up @@ -151,7 +152,6 @@ def delete_mods_folder(self):
print(f"Deleting {mods_folder}")
try:
self.remove_read_only_attribute(os.path.expanduser("~/AppData/Roaming/.minecraft/mods/.git/objects/pack"))

except:
pass
shutil.rmtree(mods_folder)
Expand Down Expand Up @@ -225,6 +225,7 @@ def update_mods(self):
mods_folder = os.path.join(self.mods_path, 'mods')
try:
repo = git.Repo(mods_folder)
repo.git.checkout('--', '.')
repo.remotes.origin.pull()
print("Repository updated successfully.")
except git.exc.GitCommandError as e:
Expand Down

0 comments on commit 53447c0

Please sign in to comment.