def update(self, ctx, args='default'):
"""Updates bot."""
try:
branch = self.config.git_branch if args == 'default' else args
# Retrieving latest code from upstream.
process1 = subprocess.check_output("git fetch".format(branch), stderr=subprocess.STDOUT,
shell=True)
process = subprocess.check_output("git checkout origin/{}".format(branch), stderr=subprocess.STDOUT,
shell=True)
await ctx.author.send("```Git pull from '{}' success```".format(branch))
except Exception as e:
await ctx.author.send("```py\nError while git pulling\n```")
raise commands.UserInputError(ctx)
评论列表
文章目录