Merge pull request #3549 from InspectorCaracal/patch-29

Update static files from the git integration command when code updates
This commit is contained in:
Griatch 2024-06-14 12:34:30 +02:00 committed by GitHub
commit 29f6121ef2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,6 +2,7 @@ import datetime
import git
from django.conf import settings
from django.core.management import call_command
import evennia
from evennia import CmdSet, InterruptCommand
@ -140,21 +141,25 @@ class GitCommand(MuxCommand):
Provide basic Git functionality within the game.
"""
caller = self.caller
reload = False
if self.action == "status":
caller.msg(self.get_status())
elif self.action == "branch" or (self.action == "checkout" and not self.args):
caller.msg(self.get_branches())
elif self.action == "checkout":
if self.checkout():
evennia.SESSION_HANDLER.portal_restart_server()
reload = self.checkout()
elif self.action == "pull":
if self.pull():
evennia.SESSION_HANDLER.portal_restart_server()
reload = self.pull()
else:
caller.msg("You can only git status, git branch, git checkout, or git pull.")
return
if reload:
# reload the server and the static file cache
evennia.SESSION_HANDLER.portal_restart_server()
call_command("collectstatic", interactive=False)
class CmdGitEvennia(GitCommand):
"""