Skip to content

Bug: update.sh tries to update node_modules READMEs (lines 245, 263) #308

@canomogollon

Description

@canomogollon

Bug Description

The update.sh script attempts to update .md and .sh files inside node_modules/, causing multiple failures when trying to download READMEs from third-party packages that don't exist in the OpenAgentsControl repository.

Evidence

Command executed:

curl -fsSL https://raw.githubusercontent.com/darrenhinde/OpenAgentsControl/main/update.sh | bash

Result:

⚠ Could not update /home/elkin/.config/opencode/node_modules/cross-spawn/README.md — restoring backup
⚠ Could not update /home/elkin/.config/opencode/node_modules/multipasta/README.md — restoring backup
... (27 failures total)
ℹ Updated: 0 file(s), failed: 27 file(s)

All failures were in node_modules/:

  • node_modules/cross-spawn/README.md
  • node_modules/multipasta/README.md
  • node_modules/yaml/README.md
  • node_modules/uuid/README.md
  • node_modules/zod/README.md
  • node_modules/fast-check/README.md
  • node_modules/effect/README.md
  • ... and 21 more packages

Root Cause

The find commands on lines 245 and 263 don't exclude node_modules/, but the one for .ts (line 254) does:

# Line 245 — BUG: NO node_modules exclusion
done < <(find "$install_dir" -name "*.md" -type f -print0)

# Line 254 — CORRECT: WITH exclusion
done < <(find "$install_dir" -name "*.ts" -type f -not -path "*/node_modules/*" -print0)

# Line 263 — BUG: NO node_modules exclusion
done < <(find "$install_dir" -name "*.sh" -type f -print0)

Proposed Fix

Add -not -path "*/node_modules/*" to the .md and .sh find commands:

# Line 245 (fix)
done < <(find "$install_dir" -name "*.md" -type f -not -path "*/node_modules/*" -print0)

# Line 263 (fix)
done < <(find "$install_dir" -name "*.sh" -type f -not -path "*/node_modules/*" -print0)

Commands to apply the fix:

sed -i 's|find "\$install_dir" -name "\\*.md" -type f -print0|find "$install_dir" -name "*.md" -type f -not -path "*/node_modules/*" -print0|' update.sh
sed -i 's|find "\$install_dir" -name "\\*.sh" -type f -print0|find "$install_dir" -name "*.sh" -type f -not -path "*/node_modules/*" -print0|' update.sh

Impact

  • Affected users: Everyone with global (~/.config/opencode/) or local installation with node_modules/
  • Severity: Medium — doesn't break the update, but generates 27 false failures and confusion
  • Workaround: Run with manual exclusion or apply fix with sed

Verification

After applying the fix:

✓ Updated: 208 file(s), failed: 5 file(s)

(No failures in node_modules/)

Environment

  • OS: Ubuntu Linux
  • Bash version: 5.x
  • Install location: ~/.config/opencode/
  • OAC version: v1.1.0 (update.sh)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions