Skip to content

🧹 Refactor mermaid installation to consolidate package manager logic#234

Merged
MiguelRodo merged 2 commits into
mainfrom
fix-mermaid-install-duplication-9307230667019660264
May 18, 2026
Merged

🧹 Refactor mermaid installation to consolidate package manager logic#234
MiguelRodo merged 2 commits into
mainfrom
fix-mermaid-install-duplication-9307230667019660264

Conversation

@MiguelRodo
Copy link
Copy Markdown
Owner

🎯 What: Consolidatd OS-specific package manager commands into reusable helper functions in src/mermaid/install.sh.
💡 Why: Extraction of the OS package manager command execution into a helper function prevents duplicating large case statements for every tool install, improving maintainability and following DRY principles.
Verification:

  • Verified bash syntax using bash -n src/mermaid/install.sh.
  • Performed manual code inspection to ensure all original logic (including Ubuntu-specific libasound2 handling and CentOS epel-release installation) is preserved.
  • Code review confirmed the solution is correct and high-quality.
    Result: Improved script readability and easier maintenance for future package additions or OS support.

PR created automatically by Jules for task 9307230667019660264 started by @MiguelRodo

…n logic

Refactored `src/mermaid/install.sh` to eliminate redundant OS-specific package installation logic.
Introduced `pkg_install` and `pkg_cleanup` helper functions to abstract package manager commands across supported OS families (Debian, Ubuntu, Fedora, CentOS, RHEL, Alpine, openSUSE, SLES).
Simplified `install_dependencies`, `install_nodejs`, and `cleanup` functions to use these new helpers, improving readability and maintainability.

Co-authored-by: MiguelRodo <23501332+MiguelRodo@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@MiguelRodo MiguelRodo merged commit eeb3d8c into main May 18, 2026
1 of 2 checks passed
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