- 
                Notifications
    
You must be signed in to change notification settings  - Fork 430
 
feat: add a prompt to modify users .gitignore (closes netlify#2038) #3595
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ngonsoto Thank you very much for your PR and taking the time to enhance our CLI!
I want to apologize upfront for being so late with my review 😬
From a consumer perspective there is no reason why the .netlify folder should not be added to the .gitignore, or at least we don't want to promote it. As all our build outputs are there and they should not be committed.
So the user input here would be in 99% the cases a "yes" – I think we can drop it for a better user experience and instead providing a meaningful log message that we adapted the users .gitignore which is stated as solution inside the issue:
Describe the solution you'd like
When the CLI modifies .gitignore we should print a log message reflecting the change to the user
Furthermore a prompt would cause issues on the link command in the CI so we would need to adapt it with a flag to pass without asking. The simpler and better approach in my humble opinion is to informing the user.
Therefore can you please update the PR with a log message?
| 
           Hi @lukasholzer, no problem. I'll be updating the PR with the requested changes.  | 
    
| /* Not ignoring .netlify folder. Add to .gitignore */ | ||
| if (!ignorePatterns || !ignorePatterns.patterns.some((pattern) => /(^|\/|\\)\.netlify($|\/|\\)/.test(pattern))) { | ||
| log() | ||
| log('Adding local .netlify folder to .gitignore file...') | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| log('Adding local .netlify folder to .gitignore file...') | |
| log('Adding local .netlify folder to .gitignore file.') | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you very much for going over and adapting the PR 🌟
🎉 Thanks for submitting a pull request! 🎉
Summary
Fixes #2038
Edits to .gitignore file are not shown to the user. This PR adds a prompt if the .netlify folder is not found in the .gitignore file and asks the user if it wants to add it.
For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.
A picture of a cute animal (not mandatory, but encouraged)
