Fix !fpull and make it always reply in PM/notice
This commit is contained in:
parent
0ed3fa249c
commit
474fff8e2b
@ -3112,24 +3112,15 @@ def player_stats_pm(cli, nick, rest):
|
|||||||
@cmd("fpull", admin_only=True)
|
@cmd("fpull", admin_only=True)
|
||||||
def fpull(cli, nick, chan, rest):
|
def fpull(cli, nick, chan, rest):
|
||||||
try:
|
try:
|
||||||
output = subprocess.check_output(('git', 'pull', '--no-progress'), stderr=subprocess.STDOUT)
|
output = subprocess.check_output(('git', 'pull'), stderr=subprocess.STDOUT)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
if chan == nick:
|
|
||||||
pm(cli, nick, '{0}: {1}'.format(type(e), e))
|
pm(cli, nick, '{0}: {1}'.format(type(e), e))
|
||||||
else:
|
|
||||||
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'))
|
pm(cli, nick, line.decode('utf-8'))
|
||||||
else:
|
else:
|
||||||
cli.msg(chan, line.decode('utf-8'))
|
|
||||||
else:
|
|
||||||
if chan == nick:
|
|
||||||
pm(cli, nick, '(no output)')
|
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