flower-trellis 0.6.8-beta.2 → 0.6.9-beta.0
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flower-trellis",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9-beta.0",
|
|
4
4
|
"description": "一键安装/升级 Trellis 并自动融合 skill-garden 强化包(默认 Claude + agents)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"commit-and-tag-version": "^12.7.3"
|
|
71
71
|
},
|
|
72
72
|
"flowerReleaseNotes": {
|
|
73
|
-
"version": "0.6.
|
|
73
|
+
"version": "0.6.9-beta.0",
|
|
74
74
|
"source": "CHANGELOG.md",
|
|
75
|
-
"body": "###
|
|
75
|
+
"body": "### 🧰 维护 Maintenance\n\n* 以 `0.6.8` 正式版为基线,延续全部修复(包括 Windows 更新检查入口与路径参数修复),发布到 `beta` 通道,供持续使用 beta 的用户升级。",
|
|
76
76
|
"truncated": false
|
|
77
77
|
},
|
|
78
78
|
"optionalDependencies": {
|
|
@@ -9,6 +9,7 @@ from __future__ import annotations
|
|
|
9
9
|
|
|
10
10
|
import argparse
|
|
11
11
|
import json
|
|
12
|
+
import ntpath
|
|
12
13
|
import os
|
|
13
14
|
import re
|
|
14
15
|
import shutil
|
|
@@ -144,25 +145,45 @@ def _project_dir(hook_input: dict) -> Path:
|
|
|
144
145
|
|
|
145
146
|
|
|
146
147
|
def _run_self_check(project_dir: Path) -> dict | None:
|
|
147
|
-
"""执行 flower-trellis self-check
|
|
148
|
+
"""执行 flower-trellis self-check,保留目标路径并解析 JSON。
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
project_dir: 要检查的项目目录。
|
|
152
|
+
Returns:
|
|
153
|
+
CLI 检查结果或安装、环境诊断。
|
|
154
|
+
"""
|
|
148
155
|
bootstrap = _check_cli(project_dir)
|
|
149
156
|
if bootstrap:
|
|
150
157
|
return bootstrap
|
|
158
|
+
# Windows 不会按 PATHEXT 为裸命令补 .CMD,执行时必须使用探测到的入口路径。
|
|
159
|
+
cli_path = shutil.which("flower-trellis")
|
|
160
|
+
if not cli_path:
|
|
161
|
+
return {"status": "cli_unavailable", "reason": "Flower 入口在执行前已不可用,请检查 PATH"}
|
|
162
|
+
command = [cli_path, "self-check", "--json", "--target", str(project_dir)]
|
|
163
|
+
run_options = {}
|
|
164
|
+
if os.name == "nt" and os.path.splitext(cli_path)[1].lower() in {".cmd", ".bat"}:
|
|
165
|
+
command_processor = os.environ.get("COMSPEC")
|
|
166
|
+
if not command_processor and os.environ.get("SystemRoot"):
|
|
167
|
+
command_processor = os.path.join(os.environ["SystemRoot"], "System32", "cmd.exe")
|
|
168
|
+
if not command_processor or not ntpath.isabs(command_processor):
|
|
169
|
+
return {"status": "cli_unavailable", "reason": "Windows 命令解释器的绝对路径无法确认,请检查 COMSPEC 与 SystemRoot"}
|
|
170
|
+
# 批处理即使 shell=False 也会经过 CMD;带引号的环境占位符保留路径中的 &、^ 和 %。
|
|
171
|
+
# 禁用 AutoRun 与延迟展开,避免宿主配置或 !变量! 改变检查命令及路径。
|
|
172
|
+
environment = os.environ.copy()
|
|
173
|
+
environment["FLOWER_UPDATE_HOOK_CLI"] = cli_path
|
|
174
|
+
environment["FLOWER_UPDATE_HOOK_TARGET"] = str(project_dir)
|
|
175
|
+
command = f'"{command_processor}" /d /v:off /s /c ""%FLOWER_UPDATE_HOOK_CLI%" self-check --json --target "%FLOWER_UPDATE_HOOK_TARGET%""'
|
|
176
|
+
run_options = {"executable": command_processor, "env": environment}
|
|
151
177
|
try:
|
|
152
178
|
result = subprocess.run(
|
|
153
|
-
|
|
154
|
-
"flower-trellis",
|
|
155
|
-
"self-check",
|
|
156
|
-
"--json",
|
|
157
|
-
"--target",
|
|
158
|
-
str(project_dir),
|
|
159
|
-
],
|
|
179
|
+
command,
|
|
160
180
|
capture_output=True,
|
|
161
181
|
text=True,
|
|
162
182
|
encoding="utf-8",
|
|
163
183
|
errors="replace",
|
|
164
184
|
timeout=SELF_CHECK_TIMEOUT_SECONDS,
|
|
165
185
|
cwd=str(project_dir),
|
|
186
|
+
**run_options,
|
|
166
187
|
)
|
|
167
188
|
except subprocess.TimeoutExpired:
|
|
168
189
|
return {"status": "cli_unavailable", "reason": "Flower CLI 检查超时,不能据此判定未安装"}
|