fix(install): handle missing provider manifests and skills dir

With the marketplace architecture, provider-manifest.sh files and the
.agents/skills/ source directory may not exist. Guard both loops so
install.sh doesn't hard-fail when they're absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-25 19:22:26 +00:00
parent e50c98f722
commit 93e3de4d02

View File

@@ -8,6 +8,7 @@ source "$REPO_ROOT/scripts/deploy-manifest.sh"
# Collect provider skill adapters from all provider-manifest.sh files
SKILL_ADAPTERS=()
for provider_manifest in "$REPO_ROOT"/providers/*/provider-manifest.sh; do
[[ -f "$provider_manifest" ]] || continue
# shellcheck source=/dev/null
source "$provider_manifest"
done
@@ -35,13 +36,19 @@ for entry in "${DEPLOY_DIRS[@]}"; do
done
# Deploy skills to canonical location — merge per-skill, never wipe the parent
# Skipped when source does not exist (marketplace architecture: skills installed via plugin)
skills_dest="$HOME/$DEPLOY_SKILLS_SRC"
mkdir -p "$skills_dest"
for skill_dir in "$REPO_ROOT/$DEPLOY_SKILLS_SRC"/*/; do
skill_name="$(basename "$skill_dir")"
rm -rf "${skills_dest:?}/${skill_name:?}"
cp -r "$skill_dir" "$skills_dest/$skill_name"
done
skills_deployed=()
if [[ -d "$REPO_ROOT/$DEPLOY_SKILLS_SRC" ]]; then
mkdir -p "$skills_dest"
for skill_dir in "$REPO_ROOT/$DEPLOY_SKILLS_SRC"/*/; do
[[ -d "$skill_dir" ]] || continue
skill_name="$(basename "$skill_dir")"
rm -rf "${skills_dest:?}/${skill_name:?}"
cp -r "$skill_dir" "$skills_dest/$skill_name"
skills_deployed+=("$skill_name")
done
fi
# Create provider skill adapters as symlinks to the canonical skills location
for adapter in "${SKILL_ADAPTERS[@]}"; do
@@ -63,7 +70,9 @@ done
for entry in "${DEPLOY_DIRS[@]}"; do
echo " ~/${entry##*:}/"
done
echo " ~/$DEPLOY_SKILLS_SRC/ (skills)"
if [[ ${#skills_deployed[@]} -gt 0 ]]; then
echo " ~/$DEPLOY_SKILLS_SRC/ (skills: ${skills_deployed[*]})"
fi
for adapter in "${SKILL_ADAPTERS[@]}"; do
echo " ~/$adapter -> ~/$DEPLOY_SKILLS_SRC (symlink)"
done