mirror of
https://github.com/theniceboy/.config.git
synced 2026-01-27 18:37:11 +08:00
migrate for opencode v1.1
This commit is contained in:
parent
3ca3ad23b0
commit
0dfb008490
2 changed files with 0 additions and 29 deletions
|
|
@ -103,11 +103,6 @@
|
|||
"edit": "deny",
|
||||
"bash": "deny",
|
||||
"webfetch": "deny"
|
||||
},
|
||||
"tools": {
|
||||
"edit": false,
|
||||
"bash": false,
|
||||
"webfetch": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,30 +29,6 @@ _op_run() {
|
|||
return 1
|
||||
fi
|
||||
|
||||
# Merge project opencode.json if it exists
|
||||
local project_config=""
|
||||
local search_dir="$PWD"
|
||||
while [ "$search_dir" != "/" ]; do
|
||||
if [ -f "$search_dir/opencode.json" ]; then
|
||||
project_config="$search_dir/opencode.json"
|
||||
break
|
||||
fi
|
||||
if [ -d "$search_dir/.git" ]; then
|
||||
break
|
||||
fi
|
||||
search_dir="${search_dir:h}"
|
||||
done
|
||||
|
||||
if [ -n "$project_config" ]; then
|
||||
print -u2 "$tag: merging project config from $project_config"
|
||||
local merged
|
||||
if merged=$(jq -s '.[0] * .[1]' "$tmp_home/opencode.json" "$project_config" 2>/dev/null); then
|
||||
printf '%s\n' "$merged" > "$tmp_home/opencode.json"
|
||||
else
|
||||
print -u2 "$tag: warning: failed to merge project config, using base only"
|
||||
fi
|
||||
fi
|
||||
|
||||
local base_agents="$base_home/AGENTS.md"
|
||||
if [ "$tag" = "se" ]; then
|
||||
local search_agents="$base_home/agent/search/AGENTS.md"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue