rails / thor

Thor is a toolkit for building powerful command-line interfaces.
http://whatisthor.com/
MIT License
5.12k stars 553 forks source link

insert_into_file print warning when change is already done #706

Closed nicolas-brousse closed 1 year ago

nicolas-brousse commented 4 years ago

If I use append_file or insert_into_file in a generator, and I execute generator twice, then File unchanged! The supplied flag value not found! warning is printed.

Is this the expected behavior. It sounds curious to me. Why doesn't it print identical or unchanged without warning, since content.include?(replacement) returns true?

Related to #683

rafaelfranca commented 4 years ago

Good point. Let's remove that warning. Can you open a PR?

nicolas-brousse commented 4 years ago

Yes, I can take a look in the following days.

nicolas-brousse commented 4 years ago

I opened a PR :)

nicolas-brousse commented 4 years ago

Let me know if you want some changes on my PR 🙂. I may have some time for the following weeks

seand7565 commented 4 years ago

Hi guys! This is a warning that we're running across as well for https://github.com/solidusio/solidus_dev_support. Not a big deal, but it is a bit jarring for users, as it looks like something went wrong. Glad to see there's a PR open, if there's anything I can do to help here please let me know :)

KjellMorgenstern commented 3 years ago

I think here is another false positive for this warning: https://github.com/stimulusreflex/stimulus_reflex/issues/118