vite_ruby icon indicating copy to clipboard operation
vite_ruby copied to clipboard

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

Open Andy9822 opened this issue 9 months ago • 4 comments

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 avatar Apr 13 '25 19:04 Andy9822

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

Andy9822 avatar Apr 22 '25 17:04 Andy9822

Hi Andy!

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

ElMassimo avatar Apr 22 '25 17:04 ElMassimo

I just ran into this as well and would love to see this PR get merged 😄

camertron avatar Jun 09 '25 04:06 camertron

hey @ElMassimo 👋, is there anything I could do or help you with so we can move this PR to finish line and get it merged?

Andy9822 avatar Aug 19 '25 22:08 Andy9822