Current Behavior:
npm pack does not ignore patterns like "dir/" in subdirectories, no matter if it was included in .gitignore or .npmignore.
Expected Behavior:
The npm documentation says:
And the git documentation says:
- "You can end patterns with a forward slash (/) to specify a directory."
- "# ignore all files in any directory named build:
build/"
Steps To Reproduce:
- In a bash environment with awk, grep, diff.
- Execute this bash script in an empty directory (it will create all the necessary files and execute the required commands to reproduce the error).
- Basically it tries to ignore the pattern "src/" (i.e. any directory with that name).
- The output should be the following comparison between git and npm using the same .gitignore file:
npm pack result git add -A result
------------------------ ------------------------
coverage/index.html coverage/index.html
dist/file1.js dist/file1.js
dist/file1.spec.js dist/file1.spec.js
dist/file2.js dist/file2.js
dist/file2.spec.js dist/file2.spec.js
> .gitignore
index.js index.js
LICENSE LICENSE
package.json package.json
README.md README.md
spec/src/test1.spec.js <
spec/src/test2.Spec.js <
test/index.js test/index.js
test/test1.js test/test1.js
test/test2.js test/test2.js
The file .gitignore is ignored by npm as expected, but npm wrongly includes two files inside an internal src directory that git ignores as expected.
Environment:
Current Behavior:
npm packdoes not ignore patterns like "dir/" in subdirectories, no matter if it was included in.gitignoreor.npmignore.Expected Behavior:
The npm documentation says:
And the git documentation says:
build/"Steps To Reproduce:
The file .gitignore is ignored by npm as expected, but npm wrongly includes two files inside an internal
srcdirectory that git ignores as expected.Environment: