Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
tar: ignore *.orig files
Browse files Browse the repository at this point in the history
Credit: @boneskull
PR-URL: #13708
Reviewed-By: @zkat
  • Loading branch information
boneskull authored and zkat committed Sep 8, 2016
1 parent 0a28dd0 commit a3a2fb9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/files/package.json.md
Expand Up @@ -203,6 +203,7 @@ Conversely, some files are always ignored:
* `.npmrc`
* `node_modules`
* `config.gypi`
* `*.orig`

## main

Expand Down
3 changes: 2 additions & 1 deletion lib/utils/tar.js
Expand Up @@ -102,7 +102,8 @@ BundledPacker.prototype.applyIgnores = function (entry, partial, entryObj) {
entry === '.npmrc' ||
entry.match(/^\..*\.swp$/) ||
entry === '.DS_Store' ||
entry.match(/^\._/)
entry.match(/^\._/) ||
entry.match(/^.*\.orig$/)
) {
return false
}
Expand Down
7 changes: 5 additions & 2 deletions test/tap/files-and-ignores.js
Expand Up @@ -404,7 +404,8 @@ test('certain files ignored unconditionally', function (t) {
'.npmrc',
'.foo.swp',
'.DS_Store',
'._ohno'
'._ohno',
'foo.orig'
]
}),
'.git': Dir({foo: File('')}),
Expand All @@ -421,7 +422,8 @@ test('certain files ignored unconditionally', function (t) {
'.foo.swp': File(''),
'.DS_Store': Dir({foo: File('')}),
'._ohno': File(''),
'._ohnoes': Dir({noes: File('')})
'._ohnoes': Dir({noes: File('')}),
'foo.orig': File('')
})
)
withFixture(t, fixture, function (done) {
Expand All @@ -440,6 +442,7 @@ test('certain files ignored unconditionally', function (t) {
t.notOk(fileExists('.DS_Store'), '.DS_Store not included')
t.notOk(fileExists('._ohno'), '._ohno not included')
t.notOk(fileExists('._ohnoes'), '._ohnoes not included')
t.notOk(fileExists('foo.orig'), 'foo.orig not included')
done()
})
})
Expand Down

0 comments on commit a3a2fb9

Please sign in to comment.