Merge claude/1
This commit is contained in:
commit
4fe1dea847
@ -414,6 +414,23 @@ webuiGenerateAppsToolsConfig() {
|
|||||||
}
|
}
|
||||||
JSON
|
JSON
|
||||||
|
|
||||||
|
# Merge per-app tool declarations so a DROPPED-IN app (e.g. from LibrePortal-Infra)
|
||||||
|
# registers its own Tools tab actions without editing this file. Each app may ship
|
||||||
|
# containers/<app>/<app>.tools.json = { "tools": [ … ] } (same schema as above);
|
||||||
|
# it sets .apps[<app>]. Core apps declared in the heredoc need no such file.
|
||||||
|
if command -v jq >/dev/null 2>&1; then
|
||||||
|
local _tj _app
|
||||||
|
for _tj in "${install_containers_dir}"*/*.tools.json; do
|
||||||
|
[[ -f "$_tj" ]] || continue
|
||||||
|
_app="$(basename "$(dirname "$_tj")")"
|
||||||
|
if jq -e . "$_tj" >/dev/null 2>&1; then
|
||||||
|
jq --arg app "$_app" --slurpfile t "$_tj" '.apps[$app] = $t[0]' "$tmp" > "$tmp.m" && mv "$tmp.m" "$tmp"
|
||||||
|
else
|
||||||
|
isNotice "Skipping invalid tools file: $_tj"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
if command -v jq >/dev/null 2>&1; then
|
if command -v jq >/dev/null 2>&1; then
|
||||||
if ! jq . "$tmp" >/dev/null 2>&1; then
|
if ! jq . "$tmp" >/dev/null 2>&1; then
|
||||||
isNotice "Generated apps-tools.json failed JSON validation; keeping existing file."
|
isNotice "Generated apps-tools.json failed JSON validation; keeping existing file."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user