From 7fcd045b7a46ef06651763e41d6c65393d509ef5 Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 28 Jun 2019 15:25:04 -0700 Subject: [PATCH] Ignore .DS_Store files as well as folders They were previously only being ignored if they were folders, but these things are typically files, not folders. Via: https://twitter.com/feross/status/1144708835770167297 --- index.js | 1 + test/include-gitignore.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/index.js b/index.js index fc328c7..7e55382 100644 --- a/index.js +++ b/index.js @@ -34,6 +34,7 @@ const defaultRules = [ 'npm-debug.log', '**/.npmrc', '.*.swp', + '.DS_Store', '**/.DS_Store/**', '._*', '**/._*/**', diff --git a/test/include-gitignore.js b/test/include-gitignore.js index d656ccb..5ecb702 100644 --- a/test/include-gitignore.js +++ b/test/include-gitignore.js @@ -38,6 +38,11 @@ t.test('setup', t => { '!.gitignore' ) + fs.writeFileSync( + path.join(pkg, '/.DS_Store'), + 'do not include me' + ) + fs.writeFileSync( path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)