3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/tldr/watcher.rb', line 3
def watch config
require_fs_watch!
tldr_command = "#{"bundle exec " if defined?(Bundler)}tldr #{config.to_full_args(ensure_args: ["--i-am-being-watched"])}"
command = "fswatch -o #{config.load_paths.reverse.join(" ")} | xargs -n1 -I{} #{tldr_command}"
print " Waiting for changes in --load-path directories: \#{config.load_paths.map(&:inspect).join(\", \")}\n\n When a file changes, TLDR will run this command:\n\n $ \#{tldr_command}\n\n Watching...\n MSG\n\n exec command\nend\n".chomp
|