Fixes to !fpull
This commit is contained in:
parent
25d80216a8
commit
7d1d68f2b8
@ -3113,13 +3113,23 @@ def player_stats_pm(cli, nick, rest):
|
|||||||
def fpull(cli, nick, chan, rest):
|
def fpull(cli, nick, chan, rest):
|
||||||
try:
|
try:
|
||||||
output = subprocess.check_output(('git', 'pull', '-q'), stderr=subprocess.STDOUT)
|
output = subprocess.check_output(('git', 'pull', '-q'), stderr=subprocess.STDOUT)
|
||||||
except Exception as e:
|
except subprocess.CalledProcessError as e:
|
||||||
|
if chan == nick:
|
||||||
|
pm(cli, nick, '{0}: {1}'.format(type(e), e))
|
||||||
|
else:
|
||||||
cli.msg(chan, '{0}: {1}'.format(type(e), e))
|
cli.msg(chan, '{0}: {1}'.format(type(e), e))
|
||||||
#raise
|
#raise
|
||||||
|
|
||||||
if output:
|
if output:
|
||||||
for line in output.splitlines():
|
for line in output.splitlines():
|
||||||
|
if chan == nick:
|
||||||
|
pm(cli, nick, line.decode('utf-8'))
|
||||||
|
else:
|
||||||
cli.msg(chan, line.decode('utf-8'))
|
cli.msg(chan, line.decode('utf-8'))
|
||||||
|
else:
|
||||||
|
if chan == nick:
|
||||||
|
pm(cli, nick, '(no output)')
|
||||||
|
else:
|
||||||
|
cli.msg(chan, '(no output)')
|
||||||
|
|
||||||
@pmcmd("fpull", admin_only=True)
|
@pmcmd("fpull", admin_only=True)
|
||||||
def fpull_pm(cli, nick, rest):
|
def fpull_pm(cli, nick, rest):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user