mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
💄
This commit is contained in:
@@ -3,14 +3,13 @@ _ = require 'underscore'
|
||||
Git = require 'git'
|
||||
|
||||
module.exports =
|
||||
loadPaths: (rootPath, ignoredNames, ignoreGitIgnoredFiles) ->
|
||||
loadPaths: (rootPath, ignoredNames, excludeGitIgnoredPaths) ->
|
||||
paths = []
|
||||
repo = Git.open(rootPath, refreshIndexOnFocus: false) if ignoreGitIgnoredFiles
|
||||
repo = Git.open(rootPath, refreshIndexOnFocus: false) if excludeGitIgnoredPaths
|
||||
isIgnored = (path) ->
|
||||
for segment in path.split('/')
|
||||
return true if _.contains(ignoredNames, segment)
|
||||
return true if repo?.isPathIgnored(fs.join(rootPath, path))
|
||||
false
|
||||
repo?.isPathIgnored(fs.join(rootPath, path))
|
||||
onFile = (path) ->
|
||||
paths.push(path) unless isIgnored(path)
|
||||
onDirectory = (path) ->
|
||||
|
||||
@@ -6,11 +6,11 @@ class LoadPathsTask extends Task
|
||||
super('fuzzy-finder/src/load-paths-handler')
|
||||
|
||||
started: ->
|
||||
ignoredNames = config.get("fuzzyFinder.ignoredNames") ? []
|
||||
ignoredNames = ignoredNames.concat(config.get("core.ignoredNames") ? [])
|
||||
ignoreGitIgnoredFiles = config.get("core.hideGitIgnoredFiles")
|
||||
ignoredNames = config.get('fuzzyFinder.ignoredNames') ? []
|
||||
ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? [])
|
||||
excludeGitIgnoredPaths = config.get('core.hideGitIgnoredFiles')
|
||||
rootPath = @rootView.project.getPath()
|
||||
@callWorkerMethod('loadPaths', rootPath, ignoredNames, ignoreGitIgnoredFiles)
|
||||
@callWorkerMethod('loadPaths', rootPath, ignoredNames, excludeGitIgnoredPaths)
|
||||
|
||||
pathsLoaded: (paths) ->
|
||||
@terminate()
|
||||
|
||||
Reference in New Issue
Block a user