mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-06-06 10:10:45 +08:00
fix: replace hardcoded ~/.desirecore paths with ${DESIRECORE_ROOT} variable (#16)
## Summary
- 将所有技能文件中的硬编码 `~/.desirecore/` 和 `$HOME/.desirecore/` 路径替换为
`${DESIRECORE_ROOT}/` 变量
- 递增 manifest.json version 至 1.2.1
## Why
dev 模式下 `DESIRECORE_HOME=~/.desirecore-dev`,硬编码路径导致技能读取错误的端口文件和目录。主仓库的
`variable-substitutor.ts` 会在运行时将 `${DESIRECORE_ROOT}` 替换为实际根目录。
## Test plan
- [ ] `npm run dev` 启动后触发任意技能,确认端口路径解析为
`~/.desirecore-dev/agent-service.port`
- [ ] prod 模式确认路径为 `~/.desirecore/agent-service.port`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
@@ -31,7 +31,7 @@ esac
|
||||
|
||||
# ── DesireCore API ──────────────────────
|
||||
DESIRECORE_API=""
|
||||
PORT_FILE="$HOME/.desirecore/agent-service.port"
|
||||
PORT_FILE="${DESIRECORE_ROOT}/agent-service.port"
|
||||
if [ -r "$PORT_FILE" ]; then
|
||||
PORT=$(cat "$PORT_FILE" 2>/dev/null | tr -d '[:space:]')
|
||||
if [ -n "$PORT" ]; then
|
||||
@@ -48,7 +48,7 @@ SYS_PIP=$(detect_tool pip3)
|
||||
[ "$(echo "$SYS_PIP" | grep -c '"path":""')" = "1" ] && SYS_PIP=$(detect_tool pip)
|
||||
|
||||
# ── DesireCore Hatch ────────────────────
|
||||
HATCH_BIN="$HOME/.desirecore/runtime/hatch/hatch"
|
||||
HATCH_BIN="${DESIRECORE_ROOT}/runtime/hatch/hatch"
|
||||
HATCH_PATH=""
|
||||
HATCH_VERSION=""
|
||||
if [ -x "$HATCH_BIN" ]; then
|
||||
@@ -57,7 +57,7 @@ if [ -x "$HATCH_BIN" ]; then
|
||||
fi
|
||||
|
||||
# Hatch 已安装的 Python 版本(直接读 local/ 目录,避免依赖 hatch 命令)
|
||||
HATCH_LOCAL="$HOME/.desirecore/runtime/hatch/local"
|
||||
HATCH_LOCAL="${DESIRECORE_ROOT}/runtime/hatch/local"
|
||||
HATCH_VERSIONS="[]"
|
||||
if [ -d "$HATCH_LOCAL" ]; then
|
||||
versions=$(ls -1 "$HATCH_LOCAL" 2>/dev/null | sort -V | tr '\n' ',' | sed 's/,$//')
|
||||
|
||||
Reference in New Issue
Block a user