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:
@@ -8,6 +8,7 @@ source "$REPO_ROOT/scripts/deploy-manifest.sh"
|
|||||||
# Collect provider skill adapters from all provider-manifest.sh files
|
# Collect provider skill adapters from all provider-manifest.sh files
|
||||||
SKILL_ADAPTERS=()
|
SKILL_ADAPTERS=()
|
||||||
for provider_manifest in "$REPO_ROOT"/providers/*/provider-manifest.sh; do
|
for provider_manifest in "$REPO_ROOT"/providers/*/provider-manifest.sh; do
|
||||||
|
[[ -f "$provider_manifest" ]] || continue
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
source "$provider_manifest"
|
source "$provider_manifest"
|
||||||
done
|
done
|
||||||
@@ -35,13 +36,19 @@ for entry in "${DEPLOY_DIRS[@]}"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Deploy skills to canonical location — merge per-skill, never wipe the parent
|
# 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"
|
skills_dest="$HOME/$DEPLOY_SKILLS_SRC"
|
||||||
mkdir -p "$skills_dest"
|
skills_deployed=()
|
||||||
for skill_dir in "$REPO_ROOT/$DEPLOY_SKILLS_SRC"/*/; do
|
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")"
|
skill_name="$(basename "$skill_dir")"
|
||||||
rm -rf "${skills_dest:?}/${skill_name:?}"
|
rm -rf "${skills_dest:?}/${skill_name:?}"
|
||||||
cp -r "$skill_dir" "$skills_dest/$skill_name"
|
cp -r "$skill_dir" "$skills_dest/$skill_name"
|
||||||
done
|
skills_deployed+=("$skill_name")
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Create provider skill adapters as symlinks to the canonical skills location
|
# Create provider skill adapters as symlinks to the canonical skills location
|
||||||
for adapter in "${SKILL_ADAPTERS[@]}"; do
|
for adapter in "${SKILL_ADAPTERS[@]}"; do
|
||||||
@@ -63,7 +70,9 @@ done
|
|||||||
for entry in "${DEPLOY_DIRS[@]}"; do
|
for entry in "${DEPLOY_DIRS[@]}"; do
|
||||||
echo " ~/${entry##*:}/"
|
echo " ~/${entry##*:}/"
|
||||||
done
|
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
|
for adapter in "${SKILL_ADAPTERS[@]}"; do
|
||||||
echo " ~/$adapter -> ~/$DEPLOY_SKILLS_SRC (symlink)"
|
echo " ~/$adapter -> ~/$DEPLOY_SKILLS_SRC (symlink)"
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user