Skip to content

Conversation

@mibradev
Copy link
Contributor

This will add /node_modules to .gitignore and also add a new line before /app/assets/builds/*.

Before:

...
# Ignore master key for decrypting credentials and more.
/config/master.key
/app/assets/builds/*
!/app/assets/builds/.keep

After:

...
# Ignore master key for decrypting credentials and more.
/config/master.key

/app/assets/builds/*
!/app/assets/builds/.keep

/node_modules

I separated the commands to make sure we don't append /node_modules twice.

@dhh
Copy link
Member

dhh commented Sep 15, 2021

Can do it in the same append 👍

@mibradev
Copy link
Contributor Author

I mean If we already have for example:

/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity

the result will be:

/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity

/app/assets/builds/*
!/app/assets/builds/.keep

/node_modules

with duplicated /node_modules. That's why I called append_to_file twice, the second one search only for \n/node_modules\n. If I combined them it will search for the whole expression \n/app/assets/builds/*\n!/app/assets/builds/.keep\n\n/node_modules\n.

@dhh dhh merged commit ee1bfdd into rails:main Sep 17, 2021
@mibradev mibradev deleted the ignore-node-modules branch September 17, 2021 13:57
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.

2 participants