Permalink
Browse files

Let git manage modules and app code seperately

  • Loading branch information...
1 parent 316d9cf commit 176ca758e4e8683f3d34cbe5ff09efea230fd984 @richo richo committed Sep 26, 2011
Showing with 9 additions and 1 deletion.
  1. +3 −1 modules.d/core_modules.py
  2. +6 −0 ourgit.py
View
4 modules.d/core_modules.py
@@ -38,7 +38,7 @@ def handle_privmsg(self, msg):
self.parent.privmsg(msg.replyto, "%s: help [module]" % (msg.nick))
class SourceModule(BawtM2):
"""Contains the commands for interacting with pyBawts internal source management and update routines"""
- _commands = ['reload', 'update', 'version']
+ _commands = ['reload', 'update', 'system-update', 'version']
privmsg_re = "^(!|%(nick)s:\s?)(%(commands)s)" % {'commands': "|".join(_commands),
'nick': '%(nick)s'}
_name = "SourceModule"
@@ -58,6 +58,8 @@ def handle_privmsg(self, msg):
#traceback.print_tb(status, file=t)
traceback.print_exception(*status.args, file=t)
elif self.m.group(2) == "update":
+ self.parent.privmsg(msg.replyto, ourgit.update_modules())
+ elif self.m.group(2) == "system-update":
self.parent.privmsg(msg.replyto, ourgit.update_git())
elif self.m.group(2) == "version":
self.parent.privmsg(msg.replyto, "%(nick)s: %(version)s on %(branch)s" %
View
6 ourgit.py
@@ -35,6 +35,12 @@ def update_git():
return data
# TODO sanity check
+def update_modules():
+ data = oneline("git --git-dir=modules.local.d/git pull")
+ logging.info("Updated source to %s" % data)
+ return data
+ # TODO sanity check
+
def checkout_git(branch):
return oneline('git checkout %s' % branch)

0 comments on commit 176ca75

Please sign in to comment.