diff --git a/tests/test-upskill.sh b/tests/test-upskill.sh index 868d6ca..9fe4f7d 100755 --- a/tests/test-upskill.sh +++ b/tests/test-upskill.sh @@ -18,7 +18,7 @@ trap cleanup EXIT pushd "$TMP" >/dev/null echo "Running upskill (first run) ..." -"$ROOT_DIR/upskill" adobe/helix-website -b agent-skills +"$ROOT_DIR/upskill" adobe/helix-website test -d .claude/skills || { echo "FAIL: .claude/skills missing"; exit 1; } count_skills=$(find .claude/skills -name 'SKILL.md' -type f | wc -l | tr -d ' ') @@ -39,7 +39,7 @@ count_markers=$(grep -cF "$marker_start" AGENTS.md) [[ "$count_markers" == "1" ]] || { echo "FAIL: duplicate start markers on first run"; exit 1; } echo "Running upskill (second run) ..." -"$ROOT_DIR/upskill" adobe/helix-website -b agent-skills +"$ROOT_DIR/upskill" adobe/helix-website count_markers2=$(grep -cF "$marker_start" AGENTS.md) [[ "$count_markers2" == "1" ]] || { echo "FAIL: duplicate start markers after second run"; exit 1; } @@ -51,7 +51,7 @@ echo "$out" | grep -q -- "---" || { echo "FAIL: discover-skills separator missin # Test gitignore insertion with -i echo "Running upskill with -i ..." -"$ROOT_DIR/upskill" -i adobe/helix-website -b agent-skills +"$ROOT_DIR/upskill" -i adobe/helix-website test -f .gitignore || { echo "FAIL: .gitignore not created"; exit 1; } grep -qF ".claude/skills/" .gitignore || { echo "FAIL: .gitignore missing skills entry"; exit 1; } @@ -60,7 +60,7 @@ grep -qF ".agents/discover-skills" .gitignore || { echo "FAIL: .gitignore missin # Ensure idempotent block start_marker="# upskill:gitignore:start" [[ $(grep -cF "$start_marker" .gitignore) == "1" ]] || { echo "FAIL: duplicate gitignore block after first -i"; exit 1; } -"$ROOT_DIR/upskill" -i adobe/helix-website -b agent-skills +"$ROOT_DIR/upskill" -i adobe/helix-website [[ $(grep -cF "$start_marker" .gitignore) == "1" ]] || { echo "FAIL: duplicate gitignore block after second -i"; exit 1; } echo "OK" diff --git a/upskill b/upskill index 9f29e6d..854b9f6 100755 --- a/upskill +++ b/upskill @@ -126,7 +126,7 @@ process_skills_directory() { local count=0 # Count skills first while IFS= read -r -d '' skill_file; do - ((count++)) + count=$((count + 1)) done < <(find "$skills_dir" -type f -name 'SKILL.md' -print0) if [[ $count -eq 0 ]]; then @@ -244,7 +244,7 @@ list_skills() { local count=0 local -a skill_names=() while IFS='|' read -r name path description; do - ((count++)) + count=$((count + 1)) skill_names+=("$name") # Make path relative to search_dir @@ -414,7 +414,7 @@ main() { log "Installing all $total_count skills..." while IFS='|' read -r name path description; do copy_skill "$path" "$dest_skills_dir" - ((skill_count++)) + skill_count=$((skill_count + 1)) done <"$tmpfile" elif [[ ${#selected_skills[@]} -gt 0 ]]; then log "Installing ${#selected_skills[@]} selected skill(s)..." @@ -423,7 +423,7 @@ main() { while IFS='|' read -r name path description; do if [[ "$name" == "$skill_name" ]]; then copy_skill "$path" "$dest_skills_dir" - ((skill_count++)) + skill_count=$((skill_count + 1)) found=1 break fi