Files
ykxmz/_build/upload_160.py
T
xmz7891 07e96a9595 1.6.0:重写 README,面向老师 / 电教 / 开发者 / 普通用户
README
- 原来的 README 是开发者视角(在解释我为什么没做某功能),
  而且通篇 AI 腔。这次按用户视角重写,讲怎么用。
- 开头就分流:老师 / 电教 / 开发者 / 普通用户,各看各的
- 定位改成教室电脑手表遥控,主场景是老师上课管教室那台电脑
- 加了电教专用一节:机房同传部署、脚本批量推、网络规划、权限收口
- 加了开发者一节:三端怎么编译、怎么跑测试、怎么打包
- 加了通信协议一节
- 常见问题、排错顺序、错误对照表都补全

版本号
- 1.5.0 -> 1.6.0(versionCode 107)
- 顺手写了通用的版本升级脚本 _build/bump_version_generic.py,
  以后升版本一条命令就行,不用手改十几个文件
2026-10-06 23:08:07 +08:00

54 lines
1.5 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
r"""上传 1.6.0 到中转站下载区,并清掉旧版本。"""
from __future__ import annotations
import sys
from pathlib import Path
ROOT = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote")
sys.path.insert(0, str(ROOT / "_build"))
from devssh import run, upload # noqa: E402
VER = "1.6.0"
REMOTE_DIR = "/root/lanremote-relay/downloads"
UPLOADS = [
(f"dist/ykxmz-agent-{VER}.zip",
f"{REMOTE_DIR}/ykxmz-agent-{VER}.zip"),
(f"dist/ykxmz-server-{VER}.zip",
f"{REMOTE_DIR}/ykxmz-server-{VER}.zip"),
(f"dist/ykxmz-watch-{VER}.apk",
f"{REMOTE_DIR}/ykxmz-watch-{VER}.apk"),
]
def main() -> int:
# 旧版本清掉,页面上只留最新的一份
print(" 清掉旧版本:")
_c, out, _e = run(f"ls {REMOTE_DIR}/ 2>/dev/null", timeout=30)
for line in (out or "").splitlines():
name = line.strip()
if name and VER not in name:
run(f"rm -f '{REMOTE_DIR}/{name}'", timeout=30)
print(f" 删除 {name}")
print()
print(" 上传 1.6.0:")
for local, remote in UPLOADS:
src = ROOT / local
if not src.is_file():
print(f" [失败] {local} 不存在")
return 1
upload(str(src), remote, 0o644)
print(f" ✓ {src.name} ({src.stat().st_size / 1024 / 1024:.2f} MB)")
print()
_c, out, _e = run(f"ls -la {REMOTE_DIR}/ | tail -6", timeout=30)
print(out)
return 0
if __name__ == "__main__":
sys.exit(main())