add "collectstatic" to git command

This commit is contained in:
InspectorCaracal 2024-05-25 21:31:15 -06:00 committed by GitHub
parent 3b84ec1b42
commit 4773ee6ac8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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