cookpad / cp8_cli

Cookpad Global CLI
MIT License
19 stars 10 forks source link

Rename config file to ~/.cp8_cli #50

Closed davidstosik closed 3 years ago

davidstosik commented 3 years ago

What

This renames the file used to store configuration from .trello_flow to .cp8_cli and provides an automated migration path for existing users.

Why

The original file name, .trello_flow, is tied to the gem's original name and may not ring a bell to recent users. I myself accidentally deleted .trello_flow a few days ago while doing some cleanup and thinking I was not using "Trello Flow" anymore. 😬

How

Wasn't sure how one would handle deprecation in the future, but I imagine the migration logic can just be removed after a few months.

I've also made an alternative PR, which changes are slightly simpler, but reinforce the dependency between GlobalConfig and ConfigStore's implementation details (for instance, using the File class and knowing more about the presence of files). https://github.com/cookpad/cp8_cli/compare/master...davidstosik:rename-store-2?expand=1 Let me know if that simpler version is preferable. 🙏🏻

(Bonus: this commit could remove GlobalConfig dependency on the file system: https://github.com/davidstosik/cp8_cli/commit/9e83ae745a9ce24cf6440b9039e0c555e9e2ca25)