@hupan56/wlkj 3.1.2 → 3.1.3

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": "@hupan56/wlkj",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "AI Product R&D Workflow - PRD/Prototype/Search/Task/Report",
5
5
  "bin": {
6
6
  "wlkj": "bin/cli.js"
@@ -88,16 +88,24 @@ def problem(msg, hint=None):
88
88
 
89
89
  def run_script(script, *args, timeout=1800):
90
90
  """跑另一个脚本, 实时透传输出。
91
- v3.0: 支持子目录化 — 先在 scripts/根找, 找不到扫各子包。"""
91
+
92
+ v3.x: 脚本已分子目录 (domain/task/, domain/kg/build/, ...), 不再固定在少数子包。
93
+ 用递归 glob 在 scripts/ 下找, 找不到才报错 —— 根治"目录一重组 run_script 就断链"
94
+ (旧版硬扫 io/setup/kg/build/test 这几个子目录, v3.0 重组后全找不到)。
95
+ """
96
+ import glob
97
+ if not script.endswith('.py'):
98
+ script = script + '.py'
92
99
  # 先试 scripts/根
93
100
  cand = os.path.join(SCRIPTS_DIR, script)
94
101
  if not os.path.isfile(cand):
95
- # 扫各子包
96
- for sub in ('io', 'setup', 'kg', 'build', 'test'):
97
- c2 = os.path.join(SCRIPTS_DIR, sub, script)
98
- if os.path.isfile(c2):
99
- cand = c2
100
- break
102
+ # 递归找 scripts/**/<script>
103
+ hits = glob.glob(os.path.join(SCRIPTS_DIR, '**', script), recursive=True)
104
+ if hits:
105
+ cand = hits[0]
106
+ else:
107
+ print('[run_script] 找不到脚本: %s (在 scripts/ 下递归也没找到)' % script)
108
+ return False
101
109
  cmd = [sys.executable, cand] + list(args)
102
110
  r = subprocess.run(cmd, cwd=BASE, timeout=timeout)
103
111
  return r.returncode == 0
@@ -658,7 +658,10 @@ def offer_cron(skip=False):
658
658
  else:
659
659
  warn(f'cron 注册失败: {(r.stderr or "").strip()[:100]}')
660
660
  else:
661
- print(' 跳过。以后可手动跑: python .qoder/scripts/setup_weekly_cron.bat')
661
+ if sys.platform == 'win32':
662
+ print(' 跳过。以后可手动跑 (双击或命令行): .qoder\\scripts\\setup_weekly_cron.bat')
663
+ else:
664
+ print(' 跳过。以后可手动跑: bash .qoder/scripts/setup_weekly_cron.sh')
662
665
 
663
666
 
664
667
  # ============================================================