20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/command-t/scanner/file_scanner/watchman_file_scanner.rb', line 20
def paths!
sockname = (
Watchman::Utils.load(get_raw_sockname),
'sockname'
)
UNIXSocket.open(sockname) do |socket|
root = Pathname.new(@path).realpath.to_s
roots = Watchman::Utils.query(['watch-list'], socket)['roots']
if !roots.include?(root)
result = Watchman::Utils.query(['watch', root], socket)
(result)
end
query = ['query', root, {
'expression' => ['type', 'f'],
'fields' => ['name'],
}]
paths = Watchman::Utils.query(query, socket)
= (paths, 'files')
if @wildignore
.select { |path| path !~ @wildignore }
else
end
end
rescue Errno::ENOENT, WatchmanError
super
end
|