更新启动文件

This commit is contained in:
2024-11-04 07:07:01 +08:00
parent 543998b673
commit bd600ee153
4 changed files with 30 additions and 4 deletions

20
routers/webhook.py Normal file
View File

@@ -0,0 +1,20 @@
import os
from fastapi import APIRouter
router = APIRouter()
# 获取标准原尺寸图
@router.get("", summary="webhook", description="自动更新")
def webhook():
print("webhook")
# 执行 Bash 命令
exit_code = os.system('git pull')
print('Exit code:', exit_code)
exit_code = os.system('npm restart reverse-5002')
print('Exit code:', exit_code)
return {"code": 200, "msg": "success"}