Skip to content

fix: Check if web entry already on Procfile.dev before appending it #542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andy9822
Copy link

@Andy9822 Andy9822 commented Apr 13, 2025

Description 📖

This pull request adds a logic to check wether the Procfile.dev already has a web entry. In case it does, we don't append a duplicate web entry.

Background 📜

This was happening because the CLI code would append the entry without checking the file content.
However, on Rails apps generated with the Rails generator, the web entry would already be in the Procfile. This would cause 2 web entries on the same file

The Fix 🔨

By changing the append method to be append_if_no_web_entry we can safely perform the action since we are now checking the file content.

Screenshots 📷

image

Fixes #541

@Andy9822 Andy9822 force-pushed the check-web-entry-on-procfile-before-appending-to-file branch from d70e471 to c8884d6 Compare April 13, 2025 19:59
@Andy9822 Andy9822 changed the title fix: Check if web entry already on Profile before appending it fix: Check if web entry already on Procfile.dev before appending it Apr 18, 2025
@Andy9822
Copy link
Author

hey @ElMassimo , is this something you'd be okay in adding to vite-ruby?

@ElMassimo
Copy link
Owner

Hi Andy!

I think it's a nice improvement, I'll test it when I have some time.

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.

bundle exec vite install duplicates web service in Procfile.dev
2 participants