mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Merge pull request #3549 from InspectorCaracal/patch-29
Update static files from the git integration command when code updates
This commit is contained in:
commit
29f6121ef2
1 changed files with 9 additions and 4 deletions
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue