qqbot-cli 1.0.0__tar.gz → 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qqbot-cli
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: QQBotMerged 启动器:一条命令装好并启动 QQ 官方机器人多开后台
5
5
  Author: L-web666
6
6
  License-Expression: AGPL-3.0-or-later
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qqbot-cli"
7
- version = "1.0.0"
7
+ version = "1.0.1"
8
8
  description = "QQBotMerged 启动器:一条命令装好并启动 QQ 官方机器人多开后台"
9
9
  readme = "PACKAGING.md"
10
10
  requires-python = ">=3.9"
@@ -13,4 +13,4 @@
13
13
  自动更新、插件机制全都照常工作,不需要改任何一行代码。
14
14
  """
15
15
 
16
- __version__ = "1.0.0"
16
+ __version__ = "1.0.1"
@@ -207,9 +207,21 @@ def do_install(install_dir: str = "", force_wizard: bool = False,
207
207
  try:
208
208
  config = wizard.run_wizard(install_dir, tag, existing)
209
209
  except (EOFError, KeyboardInterrupt):
210
+ # 用户中途按了 Ctrl+C / 输入被关掉(管道里跑、CI)。
211
+ # **程序文件已经装好了,必须照常写 marker**,否则 `is_installed()`
212
+ # 判为没装,下次 `qqbot` 会重新下载一遍 —— 白费一次下载和装依赖。
213
+ # 但 config.json 没写成,所以一个劲儿启动也没用,改为提示补配置。
210
214
  print()
215
+ runner.write_marker(install_dir, {
216
+ "tag": tag,
217
+ "sha256": result.get("sha256") or "",
218
+ "cli_version": __version__,
219
+ "needs_config": True,
220
+ })
221
+ paths.remember_install_dir(install_dir)
211
222
  _info("向导已取消,程序文件已经装好了。")
212
- _info("之后运行 qqbot 会继续问配置。")
223
+ _info("还没写配置,所以暂时不能直接启动。")
224
+ _info("运行 `qqbot init` 补完配置即可(不会重新下载)。")
213
225
  return 0
214
226
  wizard.write_config(install_dir, config)
215
227
  _ok("已生成 config.json")
@@ -497,6 +509,13 @@ def main(argv: Optional[List[str]] = None) -> int:
497
509
  remembered = paths.remembered_install_dir()
498
510
  if not dir_given and remembered and runner.is_installed(remembered) \
499
511
  and not args.upgrade:
512
+ # 装过但上次向导被取消了(没写 config.json)→ 补配置,而不是启动个空程序
513
+ marker = runner.read_marker(remembered)
514
+ if marker.get("needs_config") and \
515
+ not os.path.exists(os.path.join(remembered, "config.json")):
516
+ _info("上次没写配置,先补一下(不会重新下载)。")
517
+ return do_install(remembered, force_wizard=True,
518
+ upgrade=False, dir_given=True)
500
519
  return do_run(remembered)
501
520
  return do_install(install_dir, upgrade=args.upgrade, dir_given=dir_given)
502
521
  except KeyboardInterrupt:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes