INNER CODE UNIT · Python

rep_update

TechXueXi/TechXueXi · SourcePackages/telegramListener.py:87

def rep_update(message):
    try:
        shell = "git -C /xuexi/code/TechXueXi pull $Sourcepath $pullbranche "
        params = message.text.split(" ")
        if len(params) > 1:
            shell += params[1]
        msg = os.popen(shell).readlines()[-1]
        if "up to date" in msg:
            bot.send_message(message.chat.id, "当前代码已经是最新的了")
        else:
            os.popen("cp -r /xuexi/code/TechXueXi/SourcePackages/* /xuexi")
            bot.send_message(message.chat.id, "代码更新完成"+msg)
    except Exception as e:
        bot.send_message(message.chat.id, "更新失败:"+str(e))


@bot.message_handler(commands=['v'], func=authorize)
def rep_update(message):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…