Skip to content

Commit a988bd2

Browse files
ducpm2303claude
andcommitted
fix: replace ((var++)) with var=$((var+1)) in validate-plugins.sh
((var++)) returns exit code 1 when var=0 under bash set -e, causing the script to terminate prematurely. Also removed set -e so the script can accumulate all errors before reporting instead of dying on the first. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9c52312 commit a988bd2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

scripts/validate-plugins.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Usage: ./scripts/validate-plugins.sh [plugin-name]
44
# Exit code: 0 if all pass, 1 if any fail
55

6-
set -euo pipefail
6+
set -uo pipefail
77

88
PLUGINS_DIR="$(cd "$(dirname "$0")/.." && pwd)/plugins"
99
ERRORS=0
@@ -15,8 +15,8 @@ GREEN='\033[0;32m'
1515
CYAN='\033[0;36m'
1616
NC='\033[0m'
1717

18-
error() { echo -e "${RED} [ERROR]${NC} $1"; ((ERRORS++)); }
19-
warn() { echo -e "${YELLOW} [WARN]${NC} $1"; ((WARNINGS++)); }
18+
error() { echo -e "${RED} [ERROR]${NC} $1"; ERRORS=$((ERRORS + 1)); }
19+
warn() { echo -e "${YELLOW} [WARN]${NC} $1"; WARNINGS=$((WARNINGS + 1)); }
2020
ok() { echo -e "${GREEN} [OK]${NC} $1"; }
2121
section() { echo -e "\n${CYAN}$1${NC}"; }
2222

@@ -53,7 +53,7 @@ validate_plugin() {
5353
if [[ -d "$plugin_dir/skills" ]]; then
5454
local skill_count=0
5555
while IFS= read -r -d '' skill_file; do
56-
((skill_count++))
56+
skill_count=$((skill_count + 1))
5757
local skill_name
5858
skill_name=$(basename "$(dirname "$skill_file")")
5959

@@ -80,7 +80,7 @@ validate_plugin() {
8080
if [[ -d "$plugin_dir/commands" ]]; then
8181
local cmd_count=0
8282
while IFS= read -r -d '' cmd_file; do
83-
((cmd_count++))
83+
cmd_count=$((cmd_count + 1))
8484
local cmd_name
8585
cmd_name=$(basename "$cmd_file" .md)
8686
if ! grep -q '^description:' "$cmd_file"; then
@@ -96,7 +96,7 @@ validate_plugin() {
9696
if [[ -d "$plugin_dir/rules" ]]; then
9797
local rule_count=0
9898
while IFS= read -r -d '' rule_file; do
99-
((rule_count++))
99+
rule_count=$((rule_count + 1))
100100
local rule_name
101101
rule_name=$(basename "$rule_file" .md)
102102
if ! grep -q '^globs:' "$rule_file"; then
@@ -121,7 +121,7 @@ validate_plugin() {
121121
if [[ -d "$plugin_dir/agents" ]]; then
122122
local agent_count=0
123123
while IFS= read -r -d '' agent_file; do
124-
((agent_count++))
124+
agent_count=$((agent_count + 1))
125125
local agent_name
126126
agent_name=$(basename "$agent_file" .md)
127127
if ! grep -q '^description:' "$agent_file"; then

0 commit comments

Comments
 (0)