Exclude core.ignoredNames when scanning project

This commit is contained in:
Kevin Sawicki
2013-05-21 18:46:03 -07:00
parent 61b5160d81
commit e7c08d1202
2 changed files with 18 additions and 0 deletions

View File

@@ -320,6 +320,22 @@ describe "Project", ->
expect(paths[0]).toBe filePath
expect(matches.length).toBe 1
it "excludes values in core.ignoredNames", ->
projectPath = '/tmp/atom-tests/folder-with-dot-git/.git'
filePath = fsUtils.join(projectPath, 'test.txt')
fsUtils.write(filePath, 'match this')
project.setPath(projectPath)
paths = []
matches = []
waitsForPromise ->
project.scan /match/, ({path, match, range}) ->
paths.push(path)
matches.push(match)
runs ->
expect(paths.length).toBe 0
expect(matches.length).toBe 0
describe "serialization", ->
it "restores the project path", ->
newProject = Project.deserialize(project.serialize())

View File

@@ -276,6 +276,8 @@ class Project
command = require.resolve('nak')
args = ['--hidden', '--ackmate', regex.source, @getPath()]
ignoredNames = config.get('core.ignoredNames') ? []
args.unshift('--ignore', ignoredNames.join(',')) if ignoredNames.length > 0
args.unshift("--addVCSIgnores") if config.get('core.excludeVcsIgnoredPaths')
new BufferedProcess({command, args, stdout, exit})
deferred