@@ -17,7 +17,7 @@ class Utils(BotPlugin):
17
17
@botcmd (admin_only = True )
18
18
def sync (self , msg , arg ):
19
19
"""Sync the repository from github.""" # Ignore QuotesBear
20
- repo = git .Repo (os . environ . get ( ' COBOT_ROOT' ) )
20
+ repo = git .Repo (self . bot_config . COBOT_ROOT )
21
21
try :
22
22
repo .remote ('origin' ).pull ('--rebase' )
23
23
yield 'Sync\' d successfully! :tada:'
@@ -27,14 +27,14 @@ def sync(self, msg, arg):
27
27
@botcmd
28
28
def get_head (self , msg , arg ):
29
29
"""Yields the head commit.""" # Ignore QuotesBear
30
- repo = git .Repo (os . environ . get ( ' COBOT_ROOT' ) )
30
+ repo = git .Repo (self . bot_config . COBOT_ROOT )
31
31
head = repo .commit ('HEAD' )
32
32
yield '`{}`: {}' .format (head .hexsha , head .message )
33
33
34
34
@botcmd (admin_only = True )
35
35
def install_requirements (self , msg , arg ):
36
36
"""Installs requirements""" # Ignore QuotesBear
37
- os .chdir (os . environ . get ( ' COBOT_ROOT' ) )
37
+ os .chdir (self . bot_config . COBOT_ROOT )
38
38
ran = run ('pip install -r requirements.txt' )
39
39
yield 'installing requirements...'
40
40
yield ran .stdout .read ().decode ('utf-8' )
0 commit comments