从 GitHub 同步 Win x64 安装包到 S3,并提供配置下载与同步 API。 Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
693 B
Python
30 lines
693 B
Python
# -*- coding: utf-8 -*-
|
|
"""Publish Clash Verge + clash.yaml to S3. Run on server with S3 env."""
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
sys.path.insert(0, str(ROOT / "backend"))
|
|
os.chdir(ROOT / "backend")
|
|
|
|
|
|
def main() -> int:
|
|
from app import clash_dl
|
|
|
|
force = "--force" in sys.argv
|
|
print("sync installer force=", force)
|
|
r = clash_dl.sync_clash_verge_installer(force=force)
|
|
print(r)
|
|
if r.get("skipped"):
|
|
y = clash_dl.publish_clash_yaml()
|
|
print("yaml", y)
|
|
print("catalog", clash_dl.catalog())
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|