Skip to content

fix: improve auto installer to short-circuit on empty package arrays (Fixes #55)#59

Merged
michaelbe812 merged 1 commit into
mainfrom
fix/improve-auto-installer-empty-arrays
Sep 11, 2025
Merged

fix: improve auto installer to short-circuit on empty package arrays (Fixes #55)#59
michaelbe812 merged 1 commit into
mainfrom
fix/improve-auto-installer-empty-arrays

Conversation

@michaelbe812

Copy link
Copy Markdown
Contributor

Summary

  • Improves the installPackages() function to short-circuit early when passed empty arrays
  • Prevents building and executing empty commands like pnpm add -D (with trailing space)
  • Updates the corresponding test to verify the new no-op behavior

Changes Made

  • Added early return in installPackages() when pkgs.length === 0
  • Modified test expectation from executing empty commands to no-op behavior
  • All tests pass with the new implementation

Test Plan

  • All existing tests pass
  • Modified test verifies no command execution for empty arrays
  • Function maintains backward compatibility for non-empty arrays
  • Works correctly with all package managers (pnpm, yarn, npm)

🤖 Generated with Claude Code

- Add early return in installPackages() when pkgs.length === 0
- Prevents building and executing empty commands like "pnpm add -D "
- Update test to verify no-op behavior for empty arrays
- Fixes issue where empty package lists would build invalid commands

Fixes #55

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@michaelbe812 michaelbe812 merged commit c3a10a0 into main Sep 11, 2025
1 of 2 checks passed
@michaelbe812 michaelbe812 deleted the fix/improve-auto-installer-empty-arrays branch September 11, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant